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

Function test_quiver_key_xy

lib/matplotlib/tests/test_quiver.py:158–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156
157@image_comparison(['quiver_key_xy.png'], remove_text=True, style='_classic_test')
158def test_quiver_key_xy():
159 # With scale_units='xy', ensure quiverkey still matches its quiver.
160 # Note that the quiver and quiverkey lengths depend on the axes aspect
161 # ratio, and that with angles='xy' their angles also depend on the axes
162 # aspect ratio.
163 X = np.arange(8)
164 Y = np.zeros(8)
165 angles = X * (np.pi / 4)
166 uv = np.exp(1j * angles)
167 U = uv.real
168 V = uv.imag
169 fig, axs = plt.subplots(2)
170 for ax, angle_str in zip(axs, ('uv', 'xy')):
171 ax.set_xlim(-1, 8)
172 ax.set_ylim(-0.2, 0.2)
173 q = ax.quiver(X, Y, U, V, pivot='middle',
174 units='xy', width=0.05,
175 scale=2, scale_units='xy',
176 angles=angle_str)
177 for x, angle in zip((0.2, 0.5, 0.8), (0, 45, 90)):
178 ax.quiverkey(q, X=x, Y=0.8, U=1, angle=angle, label='', color='b')
179
180
181@image_comparison(['barbs_test_image.png'], remove_text=True, style='_classic_test')

Callers

nothing calls this directly

Calls 5

quiverkeyMethod · 0.80
subplotsMethod · 0.45
set_xlimMethod · 0.45
set_ylimMethod · 0.45
quiverMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…