@@ -567,17 +567,25 @@ def boxplot_frame_groupby(
567
567
568
568
Examples
569
569
--------
570
- >>> import itertools
571
- >>> tuples = [t for t in itertools.product(range(1000), range(4))]
572
- >>> index = pd.MultiIndex.from_tuples(tuples, names=['lvl0', 'lvl1'])
573
- >>> data = np.random.randn(len(index),4)
574
- >>> df = pd.DataFrame(data, columns=list('ABCD'), index=index)
575
- >>>
576
- >>> grouped = df.groupby(level='lvl1')
577
- >>> boxplot_frame_groupby(grouped)
578
- >>>
579
- >>> grouped = df.unstack(level='lvl1').groupby(level=0, axis=1)
580
- >>> boxplot_frame_groupby(grouped, subplots=False)
570
+ You can create boxplots for grouped data and show them as separate subplots:
571
+
572
+ .. plot::
573
+ :context: close-figs
574
+
575
+ >>> import itertools
576
+ >>> tuples = [t for t in itertools.product(range(1000), range(4))]
577
+ >>> index = pd.MultiIndex.from_tuples(tuples, names=['lvl0', 'lvl1'])
578
+ >>> data = np.random.randn(len(index),4)
579
+ >>> df = pd.DataFrame(data, columns=list('ABCD'), index=index)
580
+ >>> grouped = df.groupby(level='lvl1')
581
+ >>> grouped.boxplot(rot=45, fontsize=12, figsize=(8,10))
582
+
583
+ The ``subplots=False`` option shows the boxplots in a single figure.
584
+
585
+ .. plot::
586
+ :context: close-figs
587
+
588
+ >>> grouped.boxplot(subplots=False, rot=45, fontsize=12)
581
589
"""
582
590
plot_backend = _get_plot_backend (backend )
583
591
return plot_backend .boxplot_frame_groupby (
0 commit comments