MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_arrow_styles

Function test_arrow_styles

lib/matplotlib/tests/test_arrow_patches.py:162–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160@image_comparison(['arrow_styles.png'], style='mpl20', remove_text=True,
161 tol=0 if platform.machine() == 'x86_64' else 0.02)
162def test_arrow_styles():
163 styles = mpatches.ArrowStyle.get_styles()
164
165 n = len(styles)
166 fig, ax = plt.subplots(figsize=(8, 8))
167 ax.set_xlim(0, 1)
168 ax.set_ylim(-1, n)
169 fig.subplots_adjust(left=0, right=1, bottom=0, top=1)
170
171 for i, stylename in enumerate(sorted(styles)):
172 patch = mpatches.FancyArrowPatch((0.1 + (i % 2)*0.05, i),
173 (0.45 + (i % 2)*0.05, i),
174 arrowstyle=stylename,
175 mutation_scale=25)
176 ax.add_patch(patch)
177
178 for i, stylename in enumerate([']-[', ']-', '-[', '|-|']):
179 style = stylename
180 if stylename[0] != '-':
181 style += ',angleA=ANGLE'
182 if stylename[-1] != '-':
183 style += ',angleB=ANGLE'
184
185 for j, angle in enumerate([-30, 60]):
186 arrowstyle = style.replace('ANGLE', str(angle))
187 patch = mpatches.FancyArrowPatch((0.55, 2*i + j), (0.9, 2*i + j),
188 arrowstyle=arrowstyle,
189 mutation_scale=25)
190 ax.add_patch(patch)
191
192
193@image_comparison(['connection_styles.png'], style='mpl20', remove_text=True,

Callers

nothing calls this directly

Calls 6

get_stylesMethod · 0.80
subplots_adjustMethod · 0.80
add_patchMethod · 0.80
subplotsMethod · 0.45
set_xlimMethod · 0.45
set_ylimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…