From acb1af335d06b0fbef18a73d5b3d12a9b7224f16 Mon Sep 17 00:00:00 2001 From: Paul Hobson Date: Mon, 5 Aug 2013 16:00:31 -0700 Subject: [PATCH 1/3] BUG: switched boxplot to return axes, not boxplot dict --- pandas/tools/plotting.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py index 5deff90244135..6dea63460c26e 100644 --- a/pandas/tools/plotting.py +++ b/pandas/tools/plotting.py @@ -1839,10 +1839,8 @@ def plot_group(grouped, ax): ax.set_yticklabels(keys, rotation=rot, fontsize=fontsize) ax.grid(grid) - ret = bp - fig.subplots_adjust(bottom=0.15, top=0.9, left=0.1, right=0.9, wspace=0.2) - return ret + return ax def format_date_labels(ax, rot): From 6311071dc1d136c8055c9da1286ac120421d9320 Mon Sep 17 00:00:00 2001 From: Paul Hobson Date: Thu, 29 Aug 2013 09:37:40 -0700 Subject: [PATCH 2/3] TST: cleaned up general test functions to ensure everything returns a plt.Axes object --- pandas/tests/test_graphics.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/tests/test_graphics.py b/pandas/tests/test_graphics.py index faaac1cbb5419..1e8972e9ebc5f 100644 --- a/pandas/tests/test_graphics.py +++ b/pandas/tests/test_graphics.py @@ -565,8 +565,7 @@ def test_boxplot(self): _check_plot_works(df.boxplot) _check_plot_works(df.boxplot, column=['one', 'two']) - _check_plot_works(df.boxplot, column=['one', 'two'], - by='indic') + _check_plot_works(df.boxplot, column=['one', 'two'], by='indic') _check_plot_works(df.boxplot, column='one', by=['indic', 'indic2']) _check_plot_works(df.boxplot, by='indic') _check_plot_works(df.boxplot, by=['indic', 'indic2']) @@ -1068,7 +1067,7 @@ def assert_is_valid_plot_return_object(objs): 'type encountered {0!r}' ''.format(el.__class__.__name__)) else: - assert isinstance(objs, (plt.Artist, tuple, dict)), \ + assert isinstance(objs, plt.Axes), \ ('objs is neither an ndarray of Artist instances nor a ' 'single Artist instance, tuple, or dict, "objs" is a {0!r} ' ''.format(objs.__class__.__name__)) From 0a7feee81f9b8237d6d31f1edde166633fd521e7 Mon Sep 17 00:00:00 2001 From: Paul Hobson Date: Thu, 29 Aug 2013 09:49:20 -0700 Subject: [PATCH 3/3] RVT: fixing valid plot obj test --- pandas/tests/test_graphics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/test_graphics.py b/pandas/tests/test_graphics.py index 1e8972e9ebc5f..dd7ccee770d7d 100644 --- a/pandas/tests/test_graphics.py +++ b/pandas/tests/test_graphics.py @@ -1067,7 +1067,7 @@ def assert_is_valid_plot_return_object(objs): 'type encountered {0!r}' ''.format(el.__class__.__name__)) else: - assert isinstance(objs, plt.Axes), \ + assert isinstance(objs, (plt.Artist, tuple, dict)), \ ('objs is neither an ndarray of Artist instances nor a ' 'single Artist instance, tuple, or dict, "objs" is a {0!r} ' ''.format(objs.__class__.__name__))