Skip to content

Commit 0756028

Browse files
committed
[WIP] DOC Fixes #8447 Printing result types for different return_type values
1 parent e9476fc commit 0756028

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

pandas/plotting/_core.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -2115,24 +2115,25 @@ def plot_series(data, kind='line', ax=None, # Series unique
21152115
returned by `boxplot`. When ``return_type='axes'`` is selected,
21162116
the matplotlib axes on which the boxplot is drawn are returned:
21172117
2118-
>>> df.boxplot(column=['Col1','Col2'], return_type='axes')
2119-
<matplotlib.axes._subplots.AxesSubplot object at ...>
2118+
>>> boxplot = df.boxplot(column=['Col1','Col2'], return_type='axes')
2119+
>>> type(boxplot)
2120+
<class 'matplotlib.axes._subplots.AxesSubplot'>
21202121
21212122
When grouping with ``by``, a Series mapping columns to ``return_type``
21222123
is returned:
21232124
2124-
>>> df.boxplot(column=['Col1','Col2'], by='X', return_type='axes')
2125-
Col1 AxesSubplot(0.1,0.15;0.363636x0.75)
2126-
Col2 AxesSubplot(0.536364,0.15;0.363636x0.75)
2127-
dtype: object
2125+
>>> boxplot = df.boxplot(column=['Col1','Col2'], by='X',
2126+
... return_type='axes')
2127+
>>> type(boxplot)
2128+
<class 'pandas.core.series.Series'>
21282129
21292130
If ``return_type`` is `None`, a NumPy array of axes with the same shape
21302131
as ``layout`` is returned:
21312132
2132-
>>> df.boxplot(column=['Col1','Col2'], by='X', return_type=None)
2133-
array([<matplotlib.axes._subplots.AxesSubplot object at ...>,
2134-
<matplotlib.axes._subplots.AxesSubplot object at ...>],
2135-
dtype=object)
2133+
>>> boxplot = df.boxplot(column=['Col1','Col2'], by='X',
2134+
... return_type=None)
2135+
>>> type(boxplot)
2136+
<class 'numpy.ndarray'>
21362137
"""
21372138

21382139

0 commit comments

Comments
 (0)