8
8
from matplotlib .testing .decorators import image_comparison , knownfailureif , cleanup
9
9
import matplotlib .pyplot as plt
10
10
11
- from pylab import *
12
11
from matplotlib import patches , path , transforms
13
12
14
13
from nose .tools import raises
23
22
@image_comparison (baseline_images = ['clipping' ], remove_text = True )
24
23
def test_clipping ():
25
24
t = np .arange (0.0 , 2.0 , 0.01 )
26
- s = np .sin (2 * pi * t )
25
+ s = np .sin (2 * np . pi * t )
27
26
28
27
fig = plt .figure ()
29
28
ax = fig .add_subplot (111 )
@@ -100,16 +99,16 @@ def test_simplify_curve():
100
99
def test_hatch ():
101
100
fig = plt .figure ()
102
101
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 = "/" ))
104
103
ax .set_xlim ((0.45 , 0.55 ))
105
104
ax .set_ylim ((0.45 , 0.55 ))
106
105
107
106
@image_comparison (baseline_images = ['fft_peaks' ], remove_text = True )
108
107
def test_fft_peaks ():
109
108
fig = plt .figure ()
110
- t = arange (65536 )
109
+ t = np . arange (65536 )
111
110
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 )))))
113
112
114
113
path = p1 [0 ].get_path ()
115
114
transform = p1 [0 ].get_transform ()
@@ -162,7 +161,7 @@ def test_start_with_moveto():
162
161
@cleanup
163
162
@raises (OverflowError )
164
163
def test_throw_rendering_complexity_exceeded ():
165
- rcParams ['path.simplify' ] = False
164
+ plt . rcParams ['path.simplify' ] = False
166
165
xx = np .arange (200000 )
167
166
yy = np .random .rand (200000 )
168
167
yy [1000 ] = np .nan
@@ -172,7 +171,7 @@ def test_throw_rendering_complexity_exceeded():
172
171
try :
173
172
fig .savefig (io .BytesIO ())
174
173
finally :
175
- rcParams ['path.simplify' ] = True
174
+ plt . rcParams ['path.simplify' ] = True
176
175
177
176
@image_comparison (baseline_images = ['clipper_edge' ], remove_text = True )
178
177
def test_clipper ():
0 commit comments