Skip to content

Commit b59f433

Browse files
committed
DOC: Improve docstring for pandas.DataFrame.plot.area
1 parent 38afa93 commit b59f433

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

pandas/plotting/_core.py

+28-5
Original file line numberDiff line numberDiff line change
@@ -3115,19 +3115,42 @@ def kde(self, bw_method=None, ind=None, **kwds):
31153115

31163116
def area(self, x=None, y=None, **kwds):
31173117
"""
3118-
Area plot
3118+
Draw an stacked area plot.
3119+
3120+
An area plot displays quantitative data visually.
3121+
This function wraps the matplotlib area function.
31193122
31203123
Parameters
31213124
----------
3122-
x, y : label or position, optional
3123-
Coordinates for each point.
3124-
`**kwds` : optional
3125+
x : label or position, optional, default None
3126+
Coordinates for X axis.
3127+
y : label or position, optional, default None
3128+
Coordinates for Y axis.
3129+
**kwds : optional
31253130
Additional keyword arguments are documented in
31263131
:meth:`pandas.DataFrame.plot`.
31273132
31283133
Returns
31293134
-------
3130-
axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them
3135+
matplotlib.axes.Axes or numpy.ndarray
3136+
Area plot, or array of area plots.
3137+
3138+
See Also
3139+
--------
3140+
pandas.DataFrame.plot : Draw plots.
3141+
3142+
Examples
3143+
--------
3144+
Draw an area plot based on the length and width of some animals:
3145+
3146+
.. plot::
3147+
:context: close-figs
3148+
3149+
>>> df = pd.DataFrame({
3150+
... 'sales': [3, 2, 3, 9, 10, 6],
3151+
... 'visits': [20, 42, 28, 62, 81, 50],
3152+
... })
3153+
>>> ax = df.plot.area()
31313154
"""
31323155
return self(kind='area', x=x, y=y, **kwds)
31333156

0 commit comments

Comments
 (0)