Skip to content

Commit e9476fc

Browse files
committed
[WIP] DOC Fixes #8447 fixed issues and shortened the number of examples for return_type
1 parent 8f1b8fb commit e9476fc

File tree

1 file changed

+2
-45
lines changed

1 file changed

+2
-45
lines changed

pandas/plotting/_core.py

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ def plot_series(data, kind='line', ax=None, # Series unique
20052005
ax : object of class matplotlib.axes.Axes, optional
20062006
The matplotlib axes to be used by boxplot.
20072007
fontsize : float or str
2008-
Tick label font size in points or as a string (e.g., large).
2008+
Tick label font size in points or as a string (e.g., `large`).
20092009
rot : int or float, default 0
20102010
The rotation angle of labels (in degrees)
20112011
with respect to the screen coordinate sytem.
@@ -2111,59 +2111,16 @@ def plot_series(data, kind='line', ax=None, # Series unique
21112111
21122112
>>> boxplot = df.boxplot(grid=False, rot=45, fontsize=15)
21132113
2114-
21152114
The parameter ``return_type`` can be used to select the type of element
21162115
returned by `boxplot`. When ``return_type='axes'`` is selected,
21172116
the matplotlib axes on which the boxplot is drawn are returned:
21182117
21192118
>>> df.boxplot(column=['Col1','Col2'], return_type='axes')
21202119
<matplotlib.axes._subplots.AxesSubplot object at ...>
21212120
2122-
If selecting ``return_type='dict'`` a dictionary containing the
2123-
lines is returned:
2124-
2125-
>>> df.boxplot(column=['Col1','Col2'], return_type='dict')
2126-
{'boxes': [<matplotlib.lines.Line2D at ...>,
2127-
<matplotlib.lines.Line2D at ...>],
2128-
'caps': [<matplotlib.lines.Line2D at ...>,
2129-
<matplotlib.lines.Line2D at ...>,
2130-
<matplotlib.lines.Line2D at ...>,
2131-
<matplotlib.lines.Line2D at ...>],
2132-
'fliers': [<matplotlib.lines.Line2D at ...>,
2133-
<matplotlib.lines.Line2D at ...>],
2134-
'means': [],
2135-
'medians': [<matplotlib.lines.Line2D at ...>,
2136-
<matplotlib.lines.Line2D at ...>],
2137-
'whiskers': [<matplotlib.lines.Line2D at ...>,
2138-
<matplotlib.lines.Line2D at ...>,
2139-
<matplotlib.lines.Line2D at ...>,
2140-
<matplotlib.lines.Line2D at ...>]}
2141-
2142-
If selecting ``return_type='both'``, a namedtuple with matplotlib axes and
2143-
Line objets is returned:
2144-
2145-
>>> df.boxplot(column=['Col1','Col2'], return_type='both')
2146-
Boxplot(ax=<matplotlib.axes._subplots.AxesSubplot object
2147-
at 0x115821128>, lines={'whiskers':
2148-
[<matplotlib.lines.Line2D object at ...>,
2149-
<matplotlib.lines.Line2D object at ...>,
2150-
<matplotlib.lines.Line2D object at ...>,
2151-
<matplotlib.lines.Line2D object at ...>],
2152-
'caps': [<matplotlib.lines.Line2D object at ...>,
2153-
<matplotlib.lines.Line2D object at ...>,
2154-
<matplotlib.lines.Line2D object at ...>,
2155-
<matplotlib.lines.Line2D object at ...>],
2156-
'boxes': [<matplotlib.lines.Line2D object at ...>,
2157-
<matplotlib.lines.Line2D object at ...>],
2158-
'medians': [<matplotlib.lines.Line2D object at ...>,
2159-
<matplotlib.lines.Line2D object at ...>],
2160-
'fliers': [<matplotlib.lines.Line2D object at ...>,
2161-
<matplotlib.lines.Line2D object at ...>], 'means': []})
2162-
21632121
When grouping with ``by``, a Series mapping columns to ``return_type``
21642122
is returned:
21652123
2166-
21672124
>>> df.boxplot(column=['Col1','Col2'], by='X', return_type='axes')
21682125
Col1 AxesSubplot(0.1,0.15;0.363636x0.75)
21692126
Col2 AxesSubplot(0.536364,0.15;0.363636x0.75)
@@ -2176,9 +2133,9 @@ def plot_series(data, kind='line', ax=None, # Series unique
21762133
array([<matplotlib.axes._subplots.AxesSubplot object at ...>,
21772134
<matplotlib.axes._subplots.AxesSubplot object at ...>],
21782135
dtype=object)
2179-
21802136
"""
21812137

2138+
21822139
@Appender(_shared_docs['boxplot'] % _shared_doc_kwargs)
21832140
def boxplot(data, column=None, by=None, ax=None, fontsize=None,
21842141
rot=0, grid=True, figsize=None, layout=None, return_type=None,

0 commit comments

Comments
 (0)