-
Notifications
You must be signed in to change notification settings - Fork 100
FIX save_image() dpi #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX save_image() dpi #241
Conversation
ok for you @mwaskom ? |
Codecov Report
@@ Coverage Diff @@
## master #241 +/- ##
=========================================
Coverage ? 64.86%
=========================================
Files ? 7
Lines ? 2479
Branches ? 494
=========================================
Hits ? 1608
Misses ? 688
Partials ? 183 |
I don't think I fully understand the failure mode here or how the PR fixes it? Could you code up a simple example to demonstrate it, ideally skipping PySurfer and just plotting a random image? |
I think we either need to pass IIUC currently we set |
There are two different matplotlib rcParams that set the dpi ( I think we should give users a way to set the DPI of their figure in a way that doesn't involve matplotlib rcParams. It won't at all be obvious why those would be relevant, and when making figures for a paper, you'll generally want a higher DPI than the matplotlib default of 72. |
Fine by me to have |
Yeah I can update the PR to add it as a parameter, I just did the least amount of change version that worked first :) But as a parameter it would only be marginally helpful because it does not actually change the number of pixels in the saved image, it just stores DPI as meta-information. I assume that’s why it was not exposed previously.
… On Jun 4, 2018, at 10:45 AM, Eric Larson ***@***.***> wrote:
Fine by me to have dpi kwarg to savefig to set the output DPI
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I guess that's a good point ... if we're limited by the DPI of the mayavi screenshot bitmap maybe it doesn't make sense to give the impression you could boost that further when saving an image file. |
True, and advanced users can still set the image metadata with |
Thanks @christianbrodbeck |
When setting different DPI in
rcParams
saved images are wrongly scaled (see below). I suspect it's because unlike matplotlib'simsave
,PySurfer
does not usedpi
when saving the image. This PR fixes this.