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

Function test_quiver3d_masked

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

Source from the content-addressed store, hash-verified

924
925@mpl3d_image_comparison(['quiver3d_masked.png'], style='mpl20')
926def test_quiver3d_masked():
927 fig = plt.figure()
928 ax = fig.add_subplot(projection='3d')
929
930 # Using mgrid here instead of ogrid because masked_where doesn't
931 # seem to like broadcasting very much...
932 x, y, z = np.mgrid[-1:0.8:10j, -1:0.8:10j, -1:0.6:3j]
933
934 u = np.sin(np.pi * x) * np.cos(np.pi * y) * np.cos(np.pi * z)
935 v = -np.cos(np.pi * x) * np.sin(np.pi * y) * np.cos(np.pi * z)
936 w = (2/3)**0.5 * np.cos(np.pi * x) * np.cos(np.pi * y) * np.sin(np.pi * z)
937 u = np.ma.masked_where((-0.4 < x) & (x < 0.1), u, copy=False)
938 v = np.ma.masked_where((0.1 < y) & (y < 0.7), v, copy=False)
939
940 ax.quiver(x, y, z, u, v, w, length=0.1, pivot='tip', normalize=True)
941
942
943@mpl3d_image_comparison(['quiver3d_colorcoded.png'], style='mpl20')

Callers

nothing calls this directly

Calls 3

figureMethod · 0.80
add_subplotMethod · 0.80
quiverMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…