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

Function test_quiver3d

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py:897–914  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

895# remove tolerance when regenerating the test image
896@mpl3d_image_comparison(['quiver3d.png'], style='mpl20', tol=0.003)
897def test_quiver3d():
898 fig = plt.figure()
899 ax = fig.add_subplot(projection='3d')
900 pivots = ['tip', 'middle', 'tail']
901 colors = ['tab:blue', 'tab:orange', 'tab:green']
902 for i, (pivot, color) in enumerate(zip(pivots, colors)):
903 x, y, z = np.meshgrid([-0.5, 0.5], [-0.5, 0.5], [-0.5, 0.5])
904 u = -x
905 v = -y
906 w = -z
907 # Offset each set in z direction
908 z += 2 * i
909 ax.quiver(x, y, z, u, v, w, length=1, pivot=pivot, color=color)
910 ax.scatter(x, y, z, color=color)
911
912 ax.set_xlim(-3, 3)
913 ax.set_ylim(-3, 3)
914 ax.set_zlim(-1, 5)
915
916
917@check_figures_equal()

Callers

nothing calls this directly

Calls 7

figureMethod · 0.80
add_subplotMethod · 0.80
set_zlimMethod · 0.80
quiverMethod · 0.45
scatterMethod · 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…