Skip to content

Commit 0d5f822

Browse files
add test for color coded quiver3d
1 parent c0b2442 commit 0d5f822

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Loading

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,19 @@ def test_quiver3d_masked():
885885
ax.quiver(x, y, z, u, v, w, length=0.1, pivot='tip', normalize=True)
886886

887887

888+
@mpl3d_image_comparison(['quiver3d_colorcoded.png'], style='mpl20')
889+
def test_quiver3d_colorcoded():
890+
fig = plt.figure()
891+
ax = fig.add_subplot(projection='3d')
892+
893+
x = y = dx = dz = np.zeros(10)
894+
z = dy = np.arange(10.)
895+
896+
color = plt.cm.Reds(dy/dy.max())
897+
ax.quiver(x, y, z, dx, dy, dz, colors=color)
898+
ax.set_ylim(0, 10)
899+
900+
888901
def test_patch_modification():
889902
fig = plt.figure()
890903
ax = fig.add_subplot(projection="3d")

0 commit comments

Comments
 (0)