From d58182ab000ea0738435fb5d8d8639a547325c8b Mon Sep 17 00:00:00 2001 From: saranti Date: Sat, 20 May 2023 15:28:09 +1000 Subject: [PATCH] Fix figure annotation example --- .../annotation_demo.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/galleries/examples/text_labels_and_annotations/annotation_demo.py b/galleries/examples/text_labels_and_annotations/annotation_demo.py index 972a920fbd12..8b310a7a1865 100644 --- a/galleries/examples/text_labels_and_annotations/annotation_demo.py +++ b/galleries/examples/text_labels_and_annotations/annotation_demo.py @@ -53,7 +53,7 @@ # any key for matplotlib.patches.polygon (e.g., facecolor) # Create our figure and data we'll use for plotting -fig, ax = plt.subplots(figsize=(3, 3)) +fig, ax = plt.subplots(figsize=(4, 4)) t = np.arange(0.0, 5.0, 0.01) s = np.cos(2*np.pi*t) @@ -63,7 +63,8 @@ ax.annotate('figure pixels', xy=(10, 10), xycoords='figure pixels') ax.annotate('figure points', - xy=(80, 80), xycoords='figure points') + xy=(107, 110), xycoords='figure points', + fontsize=12) ax.annotate('figure fraction', xy=(.025, .975), xycoords='figure fraction', horizontalalignment='left', verticalalignment='top', @@ -72,14 +73,14 @@ # The following examples show off how these arrows are drawn. ax.annotate('point offset from data', - xy=(2, 1), xycoords='data', - xytext=(-15, 25), textcoords='offset points', + xy=(3, 1), xycoords='data', + xytext=(-10, 90), textcoords='offset points', arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='right', verticalalignment='bottom') + horizontalalignment='center', verticalalignment='bottom') ax.annotate('axes fraction', - xy=(3, 1), xycoords='data', - xytext=(0.8, 0.95), textcoords='axes fraction', + xy=(2, 1), xycoords='data', + xytext=(0.36, 0.68), textcoords='axes fraction', arrowprops=dict(facecolor='black', shrink=0.05), horizontalalignment='right', verticalalignment='top')