88from matplotlib .testing .decorators import image_comparison , knownfailureif , cleanup
99import matplotlib .pyplot as plt
1010
11- from pylab import *
12- import numpy as np
1311from matplotlib import patches , path , transforms
1412
1513from nose .tools import raises
2422@image_comparison (baseline_images = ['clipping' ], remove_text = True )
2523def test_clipping ():
2624 t = np .arange (0.0 , 2.0 , 0.01 )
27- s = np .sin (2 * pi * t )
25+ s = np .sin (2 * np . pi * t )
2826
2927 fig = plt .figure ()
3028 ax = fig .add_subplot (111 )
@@ -101,16 +99,16 @@ def test_simplify_curve():
10199def test_hatch ():
102100 fig = plt .figure ()
103101 ax = fig .add_subplot (111 )
104- ax .add_patch (Rectangle ((0 , 0 ), 1 , 1 , fill = False , hatch = "/" ))
102+ ax .add_patch (plt . Rectangle ((0 , 0 ), 1 , 1 , fill = False , hatch = "/" ))
105103 ax .set_xlim ((0.45 , 0.55 ))
106104 ax .set_ylim ((0.45 , 0.55 ))
107105
108106@image_comparison (baseline_images = ['fft_peaks' ], remove_text = True )
109107def test_fft_peaks ():
110108 fig = plt .figure ()
111- t = arange (65536 )
109+ t = np . arange (65536 )
112110 ax = fig .add_subplot (111 )
113- 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 )))))
114112
115113 path = p1 [0 ].get_path ()
116114 transform = p1 [0 ].get_transform ()
@@ -163,7 +161,7 @@ def test_start_with_moveto():
163161@cleanup
164162@raises (OverflowError )
165163def test_throw_rendering_complexity_exceeded ():
166- rcParams ['path.simplify' ] = False
164+ plt . rcParams ['path.simplify' ] = False
167165 xx = np .arange (200000 )
168166 yy = np .random .rand (200000 )
169167 yy [1000 ] = np .nan
@@ -173,7 +171,7 @@ def test_throw_rendering_complexity_exceeded():
173171 try :
174172 fig .savefig (io .BytesIO ())
175173 finally :
176- rcParams ['path.simplify' ] = True
174+ plt . rcParams ['path.simplify' ] = True
177175
178176@image_comparison (baseline_images = ['clipper_edge' ], remove_text = True )
179177def test_clipper ():
0 commit comments