diff --git a/pandas/tests/plotting/common.py b/pandas/tests/plotting/common.py index 92e2dc7b5d934..c31d8b539ae6f 100644 --- a/pandas/tests/plotting/common.py +++ b/pandas/tests/plotting/common.py @@ -53,6 +53,7 @@ def setUp(self): self.mpl_ge_1_4_0 = plotting._mpl_ge_1_4_0() self.mpl_ge_1_5_0 = plotting._mpl_ge_1_5_0() self.mpl_ge_2_0_0 = plotting._mpl_ge_2_0_0() + self.mpl_ge_2_0_1 = plotting._mpl_ge_2_0_1() if self.mpl_ge_1_4_0: self.bp_n_objects = 7 diff --git a/pandas/tests/plotting/test_hist_method.py b/pandas/tests/plotting/test_hist_method.py index 22de7055e3cea..380bdc12abce4 100644 --- a/pandas/tests/plotting/test_hist_method.py +++ b/pandas/tests/plotting/test_hist_method.py @@ -241,8 +241,8 @@ def test_hist_layout(self): @slow # GH 9351 def test_tight_layout(self): - if self.mpl_ge_2_0_0: - df = DataFrame(randn(100, 2)) + if self.mpl_ge_2_0_1: + df = DataFrame(randn(100, 3)) _check_plot_works(df.hist) self.plt.tight_layout() diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py index d46c38c117445..d311b0e6d83eb 100644 --- a/pandas/tools/plotting.py +++ b/pandas/tools/plotting.py @@ -150,6 +150,14 @@ def _mpl_ge_2_0_0(): return False +def _mpl_ge_2_0_1(): + try: + import matplotlib + return matplotlib.__version__ >= LooseVersion('2.0.1') + except ImportError: + return False + + if _mpl_ge_1_5_0(): # Compat with mp 1.5, which uses cycler. import cycler