@@ -33,20 +33,25 @@ def _skip_if_no_scipy():
3333 except ImportError :
3434 raise nose .SkipTest ("no scipy" )
3535
36+
3637@tm .mplskip
3738class TestPlotBase (tm .TestCase ):
3839
3940 def setUp (self ):
41+
42+ import matplotlib as mpl
43+ mpl .rcdefaults ()
44+
4045 n = 100
4146 with tm .RNGContext (42 ):
4247 gender = tm .choice (['Male' , 'Female' ], size = n )
4348 classroom = tm .choice (['A' , 'B' , 'C' ], size = n )
4449
4550 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 )})
5055
5156 def tearDown (self ):
5257 tm .close ()
@@ -120,7 +125,6 @@ def _check_visible(self, collections, visible=True):
120125 for patch in collections :
121126 self .assertEqual (patch .get_visible (), visible )
122127
123-
124128 def _get_colors_mapped (self , series , colors ):
125129 unique = series .unique ()
126130 # unique and colors length can be differed
@@ -338,6 +342,8 @@ class TestSeriesPlots(TestPlotBase):
338342 def setUp (self ):
339343 TestPlotBase .setUp (self )
340344 import matplotlib as mpl
345+ mpl .rcdefaults ()
346+
341347 self .mpl_le_1_2_1 = str (mpl .__version__ ) <= LooseVersion ('1.2.1' )
342348 self .ts = tm .makeTimeSeries ()
343349 self .ts .name = 'ts'
@@ -706,6 +712,8 @@ class TestDataFramePlots(TestPlotBase):
706712 def setUp (self ):
707713 TestPlotBase .setUp (self )
708714 import matplotlib as mpl
715+ mpl .rcdefaults ()
716+
709717 self .mpl_le_1_2_1 = str (mpl .__version__ ) <= LooseVersion ('1.2.1' )
710718
711719 self .tdf = tm .makeTimeDataFrame ()
@@ -2100,7 +2108,7 @@ def test_errorbar_scatter(self):
21002108 df = DataFrame (np .random .randn (5 , 2 ), index = range (5 ), columns = ['x' , 'y' ])
21012109 df_err = DataFrame (np .random .randn (5 , 2 ) / 5 ,
21022110 index = range (5 ), columns = ['x' , 'y' ])
2103-
2111+
21042112 ax = _check_plot_works (df .plot , kind = 'scatter' , x = 'x' , y = 'y' )
21052113 self ._check_has_errorbars (ax , xerr = 0 , yerr = 0 )
21062114 ax = _check_plot_works (df .plot , kind = 'scatter' , x = 'x' , y = 'y' , xerr = df_err )
0 commit comments