@@ -604,22 +604,18 @@ def test_const_xy():
604604@image_comparison (baseline_images = ['polar_wrap_180' , 'polar_wrap_360' ],
605605 style = 'default' )
606606def test_polar_wrap ():
607- D2R = np .pi / 180.0
608-
609607 fig = plt .figure ()
610-
611608 plt .subplot (111 , polar = True )
612-
613- plt .polar ([179 * D2R , - 179 * D2R ], [0.2 , 0.1 ], "b.-" )
614- plt .polar ([179 * D2R , 181 * D2R ], [0.2 , 0.1 ], "g.-" )
609+ plt .polar (np .deg2rad ([179 , - 179 ]), [0.2 , 0.1 ], "b.-" )
610+ plt .polar (np .deg2rad ([179 , 181 ]), [0.2 , 0.1 ], "g.-" )
615611 plt .rgrids ([0.05 , 0.1 , 0.15 , 0.2 , 0.25 , 0.3 ])
616612 assert len (fig .axes ) == 1 , 'More than one polar axes created.'
617- fig = plt .figure ()
618613
614+ fig = plt .figure ()
619615 plt .subplot (111 , polar = True )
620- plt .polar ([ 2 * D2R , - 2 * D2R ] , [0.2 , 0.1 ], "b.-" )
621- plt .polar ([ 2 * D2R , 358 * D2R ] , [0.2 , 0.1 ], "g.-" )
622- plt .polar ([358 * D2R , 2 * D2R ] , [0.2 , 0.1 ], "r.-" )
616+ plt .polar (np . deg2rad ([ 2 , - 2 ]) , [0.2 , 0.1 ], "b.-" )
617+ plt .polar (np . deg2rad ([ 2 , 358 ]) , [0.2 , 0.1 ], "g.-" )
618+ plt .polar (np . deg2rad ( [358 , 2 ]) , [0.2 , 0.1 ], "r.-" )
623619 plt .rgrids ([0.05 , 0.1 , 0.15 , 0.2 , 0.25 , 0.3 ])
624620
625621
@@ -1253,11 +1249,11 @@ def test_arc_ellipse():
12531249 width , height = 1e-1 , 3e-1
12541250 angle = - 30
12551251
1256- theta = np .arange ( 0.0 , 360.0 , 1.0 ) * np . pi / 180.0
1252+ theta = np .deg2rad ( np . arange ( 360 ))
12571253 x = width / 2. * np .cos (theta )
12581254 y = height / 2. * np .sin (theta )
12591255
1260- rtheta = angle * np .pi / 180.
1256+ rtheta = np .deg2rad ( angle )
12611257 R = np .array ([
12621258 [np .cos (rtheta ), - np .sin (rtheta )],
12631259 [np .sin (rtheta ), np .cos (rtheta )]])
0 commit comments