Skip to content

Commit 3247078

Browse files
committed
ENH: return boxplot dict from DataFrame.boxplot, #985
1 parent a9110dd commit 3247078

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pandas/tools/plotting.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,9 @@ def plot_group(grouped, ax):
575575

576576
fig, axes = _grouped_plot_by_column(plot_group, data, columns=columns,
577577
by=by, grid=grid, figsize=figsize)
578-
ax = axes
578+
579+
# Return axes in multiplot case, maybe revisit later # 985
580+
ret = axes
579581
else:
580582
if ax is None:
581583
ax = _gca()
@@ -586,12 +588,17 @@ def plot_group(grouped, ax):
586588
else:
587589
cols = data.columns
588590
keys = [_stringify(x) for x in cols]
589-
ax.boxplot(list(data[cols].values.T))
591+
592+
# Return boxplot dict in single plot case
593+
594+
bp = ax.boxplot(list(data[cols].values.T))
590595
ax.set_xticklabels(keys, rotation=rot, fontsize=fontsize)
591596
ax.grid(grid)
592597

598+
ret = bp
599+
593600
fig.subplots_adjust(bottom=0.15, top=0.9, left=0.1, right=0.9, wspace=0.2)
594-
return ax
601+
return ret
595602

596603

597604
def _stringify(x):

0 commit comments

Comments
 (0)