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

Function test_quiverkey_angles

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

Source from the content-addressed store, hash-verified

257
258
259def test_quiverkey_angles():
260 # Check that only a single arrow is plotted for a quiverkey when an array
261 # of angles is given to the original quiver plot
262 fig, ax = plt.subplots()
263
264 X, Y = np.meshgrid(np.arange(2), np.arange(2))
265 U = V = angles = np.ones_like(X)
266
267 q = ax.quiver(X, Y, U, V, angles=angles)
268 qk = ax.quiverkey(q, 1, 1, 2, 'Label')
269 # The arrows are only created when the key is drawn
270 fig.canvas.draw()
271 assert len(qk.vector.get_paths()) == 1
272
273
274def test_quiverkey_angles_xy_aitoff():

Callers

nothing calls this directly

Calls 5

quiverkeyMethod · 0.80
subplotsMethod · 0.45
quiverMethod · 0.45
drawMethod · 0.45
get_pathsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…