@@ -757,16 +757,25 @@ def test_mixedsamplesraises():
757
757
ax .plot_surface (X , Y , Z , cstride = 50 , rcount = 10 )
758
758
759
759
760
- @mpl3d_image_comparison (
761
- ['quiver3d.png' , 'quiver3d_pivot_middle.png' , 'quiver3d_pivot_tail.png' ])
760
+ @mpl3d_image_comparison (['quiver3d.png' ], style = 'mpl20' )
762
761
def test_quiver3d ():
763
- x , y , z = np .ogrid [- 1 :0.8 :10j , - 1 :0.8 :10j , - 1 :0.6 :3j ]
764
- u = np .sin (np .pi * x ) * np .cos (np .pi * y ) * np .cos (np .pi * z )
765
- v = - np .cos (np .pi * x ) * np .sin (np .pi * y ) * np .cos (np .pi * z )
766
- w = (2 / 3 )** 0.5 * np .cos (np .pi * x ) * np .cos (np .pi * y ) * np .sin (np .pi * z )
767
- for pivot in ['tip' , 'middle' , 'tail' ]:
768
- ax = plt .figure ().add_subplot (projection = '3d' )
769
- ax .quiver (x , y , z , u , v , w , length = 0.1 , pivot = pivot , normalize = True )
762
+ fig = plt .figure ()
763
+ ax = fig .add_subplot (projection = '3d' )
764
+ pivots = ['tip' , 'middle' , 'tail' ]
765
+ colors = ['tab:blue' , 'tab:orange' , 'tab:green' ]
766
+ for i , (pivot , color ) in enumerate (zip (pivots , colors )):
767
+ x , y , z = np .meshgrid ([- 0.5 , 0.5 ], [- 0.5 , 0.5 ], [- 0.5 , 0.5 ])
768
+ u = - x
769
+ v = - y
770
+ w = - z
771
+ # Offset each set in z direction
772
+ z += 2 * i
773
+ ax .quiver (x , y , z , u , v , w , length = 1 , pivot = pivot , color = color )
774
+ ax .scatter (x , y , z , color = color )
775
+
776
+ ax .set_xlim (- 3 , 3 )
777
+ ax .set_ylim (- 3 , 3 )
778
+ ax .set_zlim (- 1 , 5 )
770
779
771
780
772
781
@check_figures_equal (extensions = ["png" ])
0 commit comments