Skip to content

Commit 75a20ff

Browse files
author
Tim Hoffmann
committed
Change coordinates in Annotations tutorial
... in the `transAxes` / "axes fraction" example. Brining the annotations closer to the coordinate axes makes it easier to see that they are really the same. Also, the previous positioning (0.5, 0.5) without centered alignment results in almost, but not exactly centering of the text in the Axes frame, which is not quite nice visually.
1 parent bf248b9 commit 75a20ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

galleries/users_explain/text/annotations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,8 @@ def custom_box_style(x0, y0, width, height, mutation_size):
569569
# coordinate system to "axes fraction":
570570

571571
fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, figsize=(6, 3))
572-
ax1.annotate("Test", xy=(0.5, 0.5), xycoords=ax1.transAxes)
573-
ax2.annotate("Test", xy=(0.5, 0.5), xycoords="axes fraction")
572+
ax1.annotate("Test", xy=(0.2, 0.2), xycoords=ax1.transAxes)
573+
ax2.annotate("Test", xy=(0.2, 0.2), xycoords="axes fraction")
574574

575575
# %%
576576
# Another commonly used `.Transform` instance is ``Axes.transData``. This

0 commit comments

Comments
 (0)