|
53 | 53 | # any key for matplotlib.patches.polygon (e.g., facecolor) |
54 | 54 |
|
55 | 55 | # Create our figure and data we'll use for plotting |
56 | | -fig, ax = plt.subplots(figsize=(3, 3)) |
| 56 | +fig, ax = plt.subplots(figsize=(4, 4)) |
57 | 57 |
|
58 | 58 | t = np.arange(0.0, 5.0, 0.01) |
59 | 59 | s = np.cos(2*np.pi*t) |
|
63 | 63 | ax.annotate('figure pixels', |
64 | 64 | xy=(10, 10), xycoords='figure pixels') |
65 | 65 | ax.annotate('figure points', |
66 | | - xy=(80, 80), xycoords='figure points') |
| 66 | + xy=(107, 110), xycoords='figure points', |
| 67 | + fontsize=12) |
67 | 68 | ax.annotate('figure fraction', |
68 | 69 | xy=(.025, .975), xycoords='figure fraction', |
69 | 70 | horizontalalignment='left', verticalalignment='top', |
|
72 | 73 | # The following examples show off how these arrows are drawn. |
73 | 74 |
|
74 | 75 | ax.annotate('point offset from data', |
75 | | - xy=(2, 1), xycoords='data', |
76 | | - xytext=(-15, 25), textcoords='offset points', |
| 76 | + xy=(3, 1), xycoords='data', |
| 77 | + xytext=(-10, 90), textcoords='offset points', |
77 | 78 | arrowprops=dict(facecolor='black', shrink=0.05), |
78 | | - horizontalalignment='right', verticalalignment='bottom') |
| 79 | + horizontalalignment='center', verticalalignment='bottom') |
79 | 80 |
|
80 | 81 | ax.annotate('axes fraction', |
81 | | - xy=(3, 1), xycoords='data', |
82 | | - xytext=(0.8, 0.95), textcoords='axes fraction', |
| 82 | + xy=(2, 1), xycoords='data', |
| 83 | + xytext=(0.36, 0.68), textcoords='axes fraction', |
83 | 84 | arrowprops=dict(facecolor='black', shrink=0.05), |
84 | 85 | horizontalalignment='right', verticalalignment='top') |
85 | 86 |
|
|
0 commit comments