8000 DOC: clarify that display space coordinates are not stable · matplotlib/matplotlib@52ab2f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 52ab2f8

Browse files
committed
DOC: clarify that display space coordinates are not stable
- add an inline comment above the transform call - promote the note to a warning
1 parent ede8e56 commit 52ab2f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tutorials/advanced/transforms_tutorial.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@
145145
ax.set_ylim(-1, 1)
146146

147147
xdata, ydata = 5, 0
148+
# This computing the transform now, if anything
149+
# (figure size, dpi, axes placement, data limits, scales..)
150+
# changes re-calling transform will get a different value.
148151
xdisplay, ydisplay = ax.transData.transform((xdata, ydata))
149152

150153
bbox = dict(boxstyle="round", fc="0.8")
@@ -166,7 +169,7 @@
166169
plt.show()
167170

168171
###############################################################################
169-
# .. note::
172+
# .. warning::
170173
#
171174
# If you run the source code in the example above in a GUI backend,
172175
# you may also find that the two arrows for the *data* and *display*

0 commit comments

Comments
 (0)
0