-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Inconsistent inset_axes position between show(), savefig(format='png') and savefig(format='pdf') #8120
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
Comments
Note: |
Setting the figure dpi to 300 should also work. There is a dpi dependence in there someplace... |
Setting the figure DPI to 300 makes the PNG look right, but not the PDF. |
attn @jklymak as another case of pdf / dpi issues |
Yes. I think it's easy to fix (in general I think the rendered width should just return 72 times the inches width so it's in pdfs dpi units like the other backends. But terrifying to then fix all the workarounds that have been added here and there! |
I updated the documentation of
There are also several examples added. The code does not forbid to specify a bounding box in pixels and use the default transform=None (i.e. the display coordinates), as this may still be useful in some limited cases. However I hope that the docs and examples are now clear enough such that people will not try to position something in pixel coordinates and then wonder why there is some dpi dependence introduced. |
I think this has substantively been fixed by the doc changes... |
Bug report
Bug summary
inset_axes inconsistently positioned between show(), savefig(...,format='png') and savefig(...format='pdf') when the dpi option is set.
Code for reproduction
Actual outcome
PDF:



PNG:
show():
Expected outcome
I would expect all the results to come out the same.
Matplotlib version
The text was updated successfully, but these errors were encountered: