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