()
| 895 | # remove tolerance when regenerating the test image |
| 896 | @mpl3d_image_comparison(['quiver3d.png'], style='mpl20', tol=0.003) |
| 897 | def 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() |
nothing calls this directly
no test coverage detected
searching dependent graphs…