@@ -83,7 +83,9 @@ class TestHistWithBy(TestPlotBase):
8383 )
8484 def test_hist_plot_by_argument (self , by , column , titles , legends , hist_df ):
8585 # GH 15079
86- axes = _check_plot_works (hist_df .plot .hist , column = column , by = by )
86+ axes = _check_plot_works (
87+ hist_df .plot .hist , column = column , by = by , default_axes = True
88+ )
8789 result_titles = [ax .get_title () for ax in axes ]
8890 result_legends = [
8991 [legend .get_text () for legend in ax .get_legend ().texts ] for ax in axes
@@ -120,7 +122,7 @@ def test_hist_plot_by_0(self, by, column, titles, legends, hist_df):
120122 df = hist_df .copy ()
121123 df = df .rename (columns = {"C" : 0 })
122124
123- axes = _check_plot_works (df .plot .hist , column = column , by = by )
125+ axes = _check_plot_works (df .plot .hist , default_axes = True , column = column , by = by )
124126 result_titles = [ax .get_title () for ax in axes ]
125127 result_legends = [
126128 [legend .get_text () for legend in ax .get_legend ().texts ] for ax in axes
@@ -142,7 +144,9 @@ def test_hist_plot_empty_list_string_tuple_by(self, by, column, hist_df):
142144 # GH 15079
143145 msg = "No group keys passed"
144146 with pytest .raises (ValueError , match = msg ):
145- _check_plot_works (hist_df .plot .hist , column = column , by = by )
147+ _check_plot_works (
148+ hist_df .plot .hist , default_axes = True , column = column , by = by
149+ )
146150
147151 @pytest .mark .slow
148152 @pytest .mark .parametrize (
@@ -274,7 +278,9 @@ class TestBoxWithBy(TestPlotBase):
274278 )
275279 def test_box_plot_by_argument (self , by , column , titles , xticklabels , hist_df ):
276280 # GH 15079
277- axes = _check_plot_works (hist_df .plot .box , column = column , by = by )
281+ axes = _check_plot_works (
282+ hist_df .plot .box , default_axes = True , column = column , by = by
283+ )
278284 result_titles = [ax .get_title () for ax in axes ]
279285 result_xticklabels = [
280286 [label .get_text () for label in ax .get_xticklabels ()] for ax in axes
@@ -313,7 +319,7 @@ def test_box_plot_by_0(self, by, column, titles, xticklabels, hist_df):
313319 df = hist_df .copy ()
314320 df = df .rename (columns = {"C" : 0 })
315321
316- axes = _check_plot_works (df .plot .box , column = column , by = by )
322+ axes = _check_plot_works (df .plot .box , default_axes = True , column = column , by = by )
317323 result_titles = [ax .get_title () for ax in axes ]
318324 result_xticklabels = [
319325 [label .get_text () for label in ax .get_xticklabels ()] for ax in axes
@@ -335,7 +341,7 @@ def test_box_plot_with_none_empty_list_by(self, by, column, hist_df):
335341 # GH 15079
336342 msg = "No group keys passed"
337343 with pytest .raises (ValueError , match = msg ):
338- _check_plot_works (hist_df .plot .box , column = column , by = by )
344+ _check_plot_works (hist_df .plot .box , default_axes = True , column = column , by = by )
339345
340346 @pytest .mark .slow
341347 @pytest .mark .parametrize (
@@ -351,7 +357,9 @@ def test_box_plot_with_none_empty_list_by(self, by, column, hist_df):
351357 )
352358 def test_box_plot_layout_with_by (self , by , column , layout , axes_num , hist_df ):
353359 # GH 15079
354- axes = _check_plot_works (hist_df .plot .box , column = column , by = by , layout = layout )
360+ axes = _check_plot_works (
361+ hist_df .plot .box , default_axes = True , column = column , by = by , layout = layout
362+ )
355363 self ._check_axes_shape (axes , axes_num = axes_num , layout = layout )
356364
357365 @pytest .mark .parametrize (
0 commit comments