You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent inset_axes position between show(), savefig(format='png') and savefig(format='pdf') #8120
changed the title [-]Inconsistent inset_axes position between show(), savefig(format='[/-][+]Inconsistent inset_axes position between show(), savefig(format='png') and savefig(format='pdf')[/+]on Feb 21, 2017
Note:
Setting bbox_transform=ax1.figure.transFigure for the inset_axes makes the positioning consistent. However, I would still expect it to be consistent without doing so.
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 inset_axes in #11060. Among other things it now includes the sentence
Note that the units of the bounding box are determined through the
transform in use. When using bbox_to_anchor it almost always makes
sense to also specify a bbox_transform. This might often be the axes
transform parent_axes.transAxes.
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.
Activity
[-]Inconsistent inset_axes position between show(), savefig(format='[/-][+]Inconsistent inset_axes position between show(), savefig(format='png') and savefig(format='pdf')[/+]sorenrasmussen commentedon Feb 21, 2017
Note:
Setting
bbox_transform=ax1.figure.transFigurefor theinset_axesmakes the positioning consistent. However, I would still expect it to be consistent without doing so.tacaswell commentedon Feb 21, 2017
Setting the figure dpi to 300 should also work.
There is a dpi dependence in there someplace...
sorenrasmussen commentedon Feb 21, 2017
Setting the figure DPI to 300 makes the PNG look right, but not the PDF.
tacaswell commentedon Sep 24, 2017
attn @jklymak as another case of pdf / dpi issues
jklymak commentedon Sep 24, 2017
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!
ImportanceOfBeingErnest commentedon Apr 17, 2018
I updated the documentation of
inset_axesin #11060. Among other things it now includes the sentenceThere 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.
jklymak commentedon Feb 12, 2019
I think this has substantively been fixed by the doc changes...