Skip to content

Commit 819f457

Browse files
committed
[WIP] DOC Fixes #8447 fixed issues and shortened the number of examples for return_type
1 parent d89d1de commit 819f457

File tree

1 file changed

+2
-45
lines changed

1 file changed

+2
-45
lines changed

pandas/plotting/_core.py

+2-45
Original file line numberDiff line numberDiff line change
@@ -2020,7 +2020,7 @@ def plot_series(data, kind='line', ax=None, # Series unique
20202020
ax : object of class matplotlib.axes.Axes, optional
20212021
The matplotlib axes to be used by boxplot.
20222022
fontsize : float or str
2023-
Tick label font size in points or as a string (e.g., large).
2023+
Tick label font size in points or as a string (e.g., `large`).
20242024
rot : int or float, default 0
20252025
The rotation angle of labels (in degrees)
20262026
with respect to the screen coordinate sytem.
@@ -2126,59 +2126,16 @@ def plot_series(data, kind='line', ax=None, # Series unique
21262126
21272127
>>> boxplot = df.boxplot(grid=False, rot=45, fontsize=15)
21282128
2129-
21302129
The parameter ``return_type`` can be used to select the type of element
21312130
returned by `boxplot`. When ``return_type='axes'`` is selected,
21322131
the matplotlib axes on which the boxplot is drawn are returned:
21332132
21342133
>>> df.boxplot(column=['Col1','Col2'], return_type='axes')
21352134
<matplotlib.axes._subplots.AxesSubplot object at ...>
21362135
2137-
If selecting ``return_type='dict'`` a dictionary containing the
2138-
lines is returned:
2139-
2140-
>>> df.boxplot(column=['Col1','Col2'], return_type='dict')
2141-
{'boxes': [<matplotlib.lines.Line2D at ...>,
2142-
<matplotlib.lines.Line2D at ...>],
2143-
'caps': [<matplotlib.lines.Line2D at ...>,
2144-
<matplotlib.lines.Line2D at ...>,
2145-
<matplotlib.lines.Line2D at ...>,
2146-
<matplotlib.lines.Line2D at ...>],
2147-
'fliers': [<matplotlib.lines.Line2D at ...>,
2148-
<matplotlib.lines.Line2D at ...>],
2149-
'means': [],
2150-
'medians': [<matplotlib.lines.Line2D at ...>,
2151-
<matplotlib.lines.Line2D at ...>],
2152-
'whiskers': [<matplotlib.lines.Line2D at ...>,
2153-
<matplotlib.lines.Line2D at ...>,
2154-
<matplotlib.lines.Line2D at ...>,
2155-
<matplotlib.lines.Line2D at ...>]}
2156-
2157-
If selecting ``return_type='both'``, a namedtuple with matplotlib axes and
2158-
Line objets is returned:
2159-
2160-
>>> df.boxplot(column=['Col1','Col2'], return_type='both')
2161-
Boxplot(ax=<matplotlib.axes._subplots.AxesSubplot object
2162-
at 0x115821128>, lines={'whiskers':
2163-
[<matplotlib.lines.Line2D object at ...>,
2164-
<matplotlib.lines.Line2D object at ...>,
2165-
<matplotlib.lines.Line2D object at ...>,
2166-
<matplotlib.lines.Line2D object at ...>],
2167-
'caps': [<matplotlib.lines.Line2D object at ...>,
2168-
<matplotlib.lines.Line2D object at ...>,
2169-
<matplotlib.lines.Line2D object at ...>,
2170-
<matplotlib.lines.Line2D object at ...>],
2171-
'boxes': [<matplotlib.lines.Line2D object at ...>,
2172-
<matplotlib.lines.Line2D object at ...>],
2173-
'medians': [<matplotlib.lines.Line2D object at ...>,
2174-
<matplotlib.lines.Line2D object at ...>],
2175-
'fliers': [<matplotlib.lines.Line2D object at ...>,
2176-
<matplotlib.lines.Line2D object at ...>], 'means': []})
2177-
21782136
When grouping with ``by``, a Series mapping columns to ``return_type``
21792137
is returned:
21802138
2181-
21822139
>>> df.boxplot(column=['Col1','Col2'], by='X', return_type='axes')
21832140
Col1 AxesSubplot(0.1,0.15;0.363636x0.75)
21842141
Col2 AxesSubplot(0.536364,0.15;0.363636x0.75)
@@ -2191,9 +2148,9 @@ def plot_series(data, kind='line', ax=None, # Series unique
21912148
array([<matplotlib.axes._subplots.AxesSubplot object at ...>,
21922149
<matplotlib.axes._subplots.AxesSubplot object at ...>],
21932150
dtype=object)
2194-
21952151
"""
21962152

2153+
21972154
@Appender(_shared_docs['boxplot'] % _shared_doc_kwargs)
21982155
def boxplot(data, column=None, by=None, ax=None, fontsize=None,
21992156
rot=0, grid=True, figsize=None, layout=None, return_type=None,

0 commit comments

Comments
 (0)