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
bboxes coordinate system of plt.annotate objects depends on range of xycoords #8475
When I plot ax.annotate objects, and then want to get the coordinates of their bboxes using fig.canvas.draw() and annotation.get_window_extent(), then the coordinate system of the bboxes depends on whether the xy of the object is between 0 and 1 (including 0 and 1), even if xycords is always set to 'data'.
In particular, if xycords are between 0 and 1 then the bbox coordinates can be transformed into data coordinates using ax.transData.inverted().transform. This is not true for xycords not in [0,1].
I would expect all Bbox objects to be in the same coordinate system (figure coordinates?), but they clearly are not.
I would expect a behaviour where the last two lines of the output above become
1.5 == 1.5
0.5 == 0.5
Matplotlib version
'1.5.3' from anaconda2
I am running this in a jupyter notebook with %matplotlib_inline
Activity
ImportanceOfBeingErnest commentedon Mar 4, 2020
I'm not able to reproduce this. Running the code with matplotlib 3.1.0 produces the expected output.
Maybe this has solved itself throughout the versions since 1.5. If anyone still has this issue please ask to reopen and provide further details.