@@ -92,6 +92,34 @@ def test_quiver_copy():
9292 assert q0 .V [0 ] == 2.0
9393
9494
95+ @image_comparison (baseline_images = ['quiver_key_pivot' ],
96+ extensions = ['png' ], remove_text = True )
97+ def test_quiver_key_pivot ():
98+ fig , ax = plt .subplots ()
99+
100+ u , v = np .mgrid [0 :2 * np .pi :10j , 0 :2 * np .pi :10j ]
101+
102+ q = ax .quiver (np .sin (u ), np .cos (v ))
103+ ax .set_xlim (- 2 , 11 )
104+ ax .set_ylim (- 2 , 11 )
105+ ax .quiverkey (q , 0.5 , 1 , 1 , 'N' , labelpos = 'N' )
106+ ax .quiverkey (q , 1 , 0.5 , 1 , 'E' , labelpos = 'E' )
107+ ax .quiverkey (q , 0.5 , 0 , 1 , 'S' , labelpos = 'S' )
108+ ax .quiverkey (q , 0 , 0.5 , 1 , 'W' , labelpos = 'W' )
109+
110+
111+ @image_comparison (baseline_images = ['barbs_test_image' ],
112+ extensions = ['png' ], remove_text = True )
113+ def test_barbs ():
114+ x = np .linspace (- 5 , 5 , 5 )
115+ X , Y = np .meshgrid (x , x )
116+ U , V = 12 * X , 12 * Y
117+ fig , ax = plt .subplots ()
118+ ax .barbs (X , Y , U , V , np .sqrt (U * U + V * V ), fill_empty = True , rounding = False ,
119+ sizes = dict (emptybarb = 0.25 , spacing = 0.2 , height = 0.3 ),
120+ cmap = 'viridis' )
121+
122+
95123if __name__ == '__main__' :
96124 import nose
97125 nose .runmodule ()
0 commit comments