Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e51711

Browse files
committed
Add arrow style image test
1 parent 4cd55c5 commit 3e51711

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

12.6 KB
Loading

lib/matplotlib/tests/test_arrow_patches.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,20 @@ def test_fancyarrow_dash():
119119
color='k')
120120
ax.add_patch(e)
121121
ax.add_patch(e2)
122+
123+
124+
@image_comparison(baseline_images=['arrow_styles'], extensions=['png'],
125+
style='mpl20', remove_text=True)
126+
def test_arrow_styles():
127+
styles = mpatches.ArrowStyle.get_styles()
128+
129+
n = len(styles)
130+
fig, ax = plt.subplots(figsize=(6, 10))
131+
ax.set_xlim(0, 1)
132+
ax.set_ylim(-1, n)
133+
134+
for i, stylename in enumerate(sorted(styles)):
135+
patch = mpatches.FancyArrowPatch((0.1, i), (0.8, i),
136+
arrowstyle=stylename,
137+
mutation_scale=25)
138+
ax.add_patch(patch)

0 commit comments

Comments
 (0)