@@ -83,7 +83,9 @@ class TestHistWithBy(TestPlotBase):
83
83
)
84
84
def test_hist_plot_by_argument (self , by , column , titles , legends , hist_df ):
85
85
# 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
+ )
87
89
result_titles = [ax .get_title () for ax in axes ]
88
90
result_legends = [
89
91
[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):
120
122
df = hist_df .copy ()
121
123
df = df .rename (columns = {"C" : 0 })
122
124
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 )
124
126
result_titles = [ax .get_title () for ax in axes ]
125
127
result_legends = [
126
128
[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):
142
144
# GH 15079
143
145
msg = "No group keys passed"
144
146
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
+ )
146
150
147
151
@pytest .mark .slow
148
152
@pytest .mark .parametrize (
@@ -274,7 +278,9 @@ class TestBoxWithBy(TestPlotBase):
274
278
)
275
279
def test_box_plot_by_argument (self , by , column , titles , xticklabels , hist_df ):
276
280
# 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
+ )
278
284
result_titles = [ax .get_title () for ax in axes ]
279
285
result_xticklabels = [
280
286
[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):
313
319
df = hist_df .copy ()
314
320
df = df .rename (columns = {"C" : 0 })
315
321
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 )
317
323
result_titles = [ax .get_title () for ax in axes ]
318
324
result_xticklabels = [
319
325
[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):
335
341
# GH 15079
336
342
msg = "No group keys passed"
337
343
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 )
339
345
340
346
@pytest .mark .slow
341
347
@pytest .mark .parametrize (
@@ -351,7 +357,9 @@ def test_box_plot_with_none_empty_list_by(self, by, column, hist_df):
351
357
)
352
358
def test_box_plot_layout_with_by (self , by , column , layout , axes_num , hist_df ):
353
359
# 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
+ )
355
363
self ._check_axes_shape (axes , axes_num = axes_num , layout = layout )
356
364
357
365
@pytest .mark .parametrize (
0 commit comments