MCPcopy
hub / github.com/matplotlib/cheatsheets / demo_con_style

Function demo_con_style

scripts/annotation-connection-styles.py:16–29  ·  view source on GitHub ↗
(ax, connectionstyle)

Source from the content-addressed store, hash-verified

14
15
16def demo_con_style(ax, connectionstyle):
17 x1, y1 = 0.3, 0.2
18 x2, y2 = 0.8, 0.6
19 ax.plot([x1, x2], [y1, y2], ".")
20 ax.annotate("",
21 xy=(x1, y1), xycoords='data',
22 xytext=(x2, y2), textcoords='data',
23 arrowprops=dict(arrowstyle="->", lw=0.5, color="0.5",
24 shrinkA=3, shrinkB=3,
25 patchA=None, patchB=None,
26 connectionstyle=connectionstyle),
27 )
28 ax.text(.05, .95, connectionstyle.replace(",", ",\n"),
29 transform=ax.transAxes, ha="left", va="top", size=4)
30
31
32fig, axs = plt.subplots(3, 3, figsize=(5.7/2.54, 5.7/2.54))

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected