diff --git a/pandas/tests/test_graphics.py b/pandas/tests/test_graphics.py index 12588afd39c0c..637f532c23122 100644 --- a/pandas/tests/test_graphics.py +++ b/pandas/tests/test_graphics.py @@ -1364,10 +1364,8 @@ def test_boxplot(self): # Multiple columns with an ax argument is not supported fig, ax = self.plt.subplots() - self.assertRaisesRegexp( - ValueError, 'existing axis', df.boxplot, - column=['Col1', 'Col2'], by='X', ax=ax - ) + with tm.assertRaisesRegexp(ValueError, 'existing axis'): + df.boxplot(column=['Col1', 'Col2'], by='X', ax=ax) # When by is None, check that all relevant lines are present in the dict fig, ax = self.plt.subplots() diff --git a/pandas/tseries/plotting.py b/pandas/tseries/plotting.py index abec1d469114f..9eecfc21be189 100644 --- a/pandas/tseries/plotting.py +++ b/pandas/tseries/plotting.py @@ -75,7 +75,6 @@ def tsplot(series, plotf, **kwargs): args.append(style) lines = plotf(ax, *args, **kwargs) - label = kwargs.get('label', None) # set date formatter, locators and rescale limits format_dateaxis(ax, ax.freq) @@ -83,7 +82,10 @@ def tsplot(series, plotf, **kwargs): ax.set_xlim(left, right) # x and y coord info - ax.format_coord = lambda t, y: "t = {} y = {:8f}".format(Period(ordinal=int(t), freq=ax.freq), y) + ax.format_coord = lambda t, y: ("t = {0} " + "y = {1:8f}".format(Period(ordinal=int(t), + freq=ax.freq), + y)) return lines