Skip to content
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

Added native dpi option for print_figure #4286

Merged
merged 3 commits into from Apr 11, 2015
Merged

Conversation

patchen
Copy link
Contributor

@patchen patchen commented Mar 27, 2015

As per #305, Added the option to set dpi='native' in canvas.print_figure(). Doing so will set the "canvas print_figure" dpi equal to the figure dpi.

@mdboom
Copy link
Member

mdboom commented Mar 27, 2015

Interesting idea, but I'm not sure the term native is terribly obvious. Maybe same or screen?

@tacaswell tacaswell added this to the proposed next point release milestone Mar 27, 2015
@patchen
Copy link
Contributor Author

patchen commented Mar 28, 2015

How about "preserve" or "figure" ?

@tacaswell
Copy link
Member

How does this interact with Figure.savefig? This change should probably be made at that level, rather than at this level. At a minimum it should be documented there as I think that is the API route that most users go through.

@patchen
Copy link
Contributor Author

patchen commented Mar 29, 2015

I moved the dpi='figure' option to the Figure.savefig() level as suggested and left the default implementations untouched.

It seems like a common gotcha with users where the Figure dpi (screen) and Figure.savefig() dpi (output) differ.

@efiring
Copy link
Member

efiring commented Mar 30, 2015

I like it.

@tacaswell
Copy link
Member

👍 from me too.

@patchen Can you add an entry to https://github.com/matplotlib/matplotlib/tree/master/doc/users/whats_new ?

The validation the the dpi kwarg should also be updated to allow 'figure' as a valid value.

@patchen
Copy link
Contributor Author

patchen commented Mar 31, 2015

The validation the the dpi kwarg should also be updated to allow 'figure' as a valid value.

@tacaswell
Can you clarify this bit for me? Thanks.

@tacaswell
Copy link
Member

If you try to do matplotlib.rcParams['savefig.dpi'] = 'figure' it will raise an exception (as 'figure' is not a valid DPI). The validation code should be updated to special case allowing 'figure'. Have a look at rcsetup.py.

@tacaswell tacaswell modified the milestones: next point release, proposed next point release Mar 31, 2015
tacaswell added a commit that referenced this pull request Apr 11, 2015
ENH : Added native dpi option for print_figure
@tacaswell tacaswell merged commit 775b7f4 into matplotlib:master Apr 11, 2015
@mdboom mdboom mentioned this pull request Dec 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants