@@ -33,20 +33,25 @@ def _skip_if_no_scipy():
33
33
except ImportError :
34
34
raise nose .SkipTest ("no scipy" )
35
35
36
+
36
37
@tm .mplskip
37
38
class TestPlotBase (tm .TestCase ):
38
39
39
40
def setUp (self ):
41
+
42
+ import matplotlib as mpl
43
+ mpl .rcdefaults ()
44
+
40
45
n = 100
41
46
with tm .RNGContext (42 ):
42
47
gender = tm .choice (['Male' , 'Female' ], size = n )
43
48
classroom = tm .choice (['A' , 'B' , 'C' ], size = n )
44
49
45
50
self .hist_df = DataFrame ({'gender' : gender ,
46
- 'classroom' : classroom ,
47
- 'height' : random .normal (66 , 4 , size = n ),
48
- 'weight' : random .normal (161 , 32 , size = n ),
49
- 'category' : random .randint (4 , size = n )})
51
+ 'classroom' : classroom ,
52
+ 'height' : random .normal (66 , 4 , size = n ),
53
+ 'weight' : random .normal (161 , 32 , size = n ),
54
+ 'category' : random .randint (4 , size = n )})
50
55
51
56
def tearDown (self ):
52
57
tm .close ()
@@ -120,7 +125,6 @@ def _check_visible(self, collections, visible=True):
120
125
for patch in collections :
121
126
self .assertEqual (patch .get_visible (), visible )
122
127
123
-
124
128
def _get_colors_mapped (self , series , colors ):
125
129
unique = series .unique ()
126
130
# unique and colors length can be differed
@@ -338,6 +342,8 @@ class TestSeriesPlots(TestPlotBase):
338
342
def setUp (self ):
339
343
TestPlotBase .setUp (self )
340
344
import matplotlib as mpl
345
+ mpl .rcdefaults ()
346
+
341
347
self .mpl_le_1_2_1 = str (mpl .__version__ ) <= LooseVersion ('1.2.1' )
342
348
self .ts = tm .makeTimeSeries ()
343
349
self .ts .name = 'ts'
@@ -706,6 +712,8 @@ class TestDataFramePlots(TestPlotBase):
706
712
def setUp (self ):
707
713
TestPlotBase .setUp (self )
708
714
import matplotlib as mpl
715
+ mpl .rcdefaults ()
716
+
709
717
self .mpl_le_1_2_1 = str (mpl .__version__ ) <= LooseVersion ('1.2.1' )
710
718
711
719
self .tdf = tm .makeTimeDataFrame ()
@@ -2100,7 +2108,7 @@ def test_errorbar_scatter(self):
2100
2108
df = DataFrame (np .random .randn (5 , 2 ), index = range (5 ), columns = ['x' , 'y' ])
2101
2109
df_err = DataFrame (np .random .randn (5 , 2 ) / 5 ,
2102
2110
index = range (5 ), columns = ['x' , 'y' ])
2103
-
2111
+
2104
2112
ax = _check_plot_works (df .plot , kind = 'scatter' , x = 'x' , y = 'y' )
2105
2113
self ._check_has_errorbars (ax , xerr = 0 , yerr = 0 )
2106
2114
ax = _check_plot_works (df .plot , kind = 'scatter' , x = 'x' , y = 'y' , xerr = df_err )
0 commit comments