88from matplotlib .testing .decorators import image_comparison , knownfailureif , cleanup
99import matplotlib .pyplot as plt
1010
11- from pylab import *
1211from matplotlib import patches , path , transforms
1312
1413from nose .tools import raises
2322@image_comparison (baseline_images = ['clipping' ], remove_text = True )
2423def test_clipping ():
2524 t = np .arange (0.0 , 2.0 , 0.01 )
26- s = np .sin (2 * pi * t )
25+ s = np .sin (2 * np . pi * t )
2726
2827 fig = plt .figure ()
2928 ax = fig .add_subplot (111 )
@@ -100,16 +99,16 @@ def test_simplify_curve():
10099def test_hatch ():
101100 fig = plt .figure ()
102101 ax = fig .add_subplot (111 )
103- ax .add_patch (Rectangle ((0 , 0 ), 1 , 1 , fill = False , hatch = "/" ))
102+ ax .add_patch (plt . Rectangle ((0 , 0 ), 1 , 1 , fill = False , hatch = "/" ))
104103 ax .set_xlim ((0.45 , 0.55 ))
105104 ax .set_ylim ((0.45 , 0.55 ))
106105
107106@image_comparison (baseline_images = ['fft_peaks' ], remove_text = True )
108107def test_fft_peaks ():
109108 fig = plt .figure ()
110- t = arange (65536 )
109+ t = np . arange (65536 )
111110 ax = fig .add_subplot (111 )
112- p1 = ax .plot (abs (fft ( sin (2 * pi * .01 * t )* blackman (len (t )))))
111+ p1 = ax .plot (abs (np . fft . fft ( np . sin (2 * np . pi * .01 * t )* np . blackman (len (t )))))
113112
114113 path = p1 [0 ].get_path ()
115114 transform = p1 [0 ].get_transform ()
@@ -162,7 +161,7 @@ def test_start_with_moveto():
162161@cleanup
163162@raises (OverflowError )
164163def test_throw_rendering_complexity_exceeded ():
165- rcParams ['path.simplify' ] = False
164+ plt . rcParams ['path.simplify' ] = False
166165 xx = np .arange (200000 )
167166 yy = np .random .rand (200000 )
168167 yy [1000 ] = np .nan
@@ -172,7 +171,7 @@ def test_throw_rendering_complexity_exceeded():
172171 try :
173172 fig .savefig (io .BytesIO ())
174173 finally :
175- rcParams ['path.simplify' ] = True
174+ plt . rcParams ['path.simplify' ] = True
176175
177176@image_comparison (baseline_images = ['clipper_edge' ], remove_text = True )
178177def test_clipper ():
0 commit comments