Skip to content

Commit 6a4c50c

Browse files
committed
DOC: Improve docstring for pandas.DataFrame.plot.area
1 parent 4131149 commit 6a4c50c

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

pandas/plotting/_core.py

+29-5
Original file line numberDiff line numberDiff line change
@@ -2818,18 +2818,42 @@ def kde(self, bw_method=None, ind=None, **kwds):
28182818

28192819
def area(self, x=None, y=None, **kwds):
28202820
"""
2821-
Area plot
2821+
Draw an area plot of the input series using matplotlib.
2822+
2823+
An area plot displays graphically quantitative data.
2824+
This function wraps the matplotlib area function.
28222825
28232826
Parameters
28242827
----------
2825-
x, y : label or position, optional
2826-
Coordinates for each point.
2827-
`**kwds` : optional
2828+
x : label or position, optional
2829+
Coordinates for X point.
2830+
y : label or position, optional
2831+
Coordinates for Y point.
2832+
kwds : optional
28282833
Keyword arguments to pass on to :py:meth:`pandas.DataFrame.plot`.
28292834
28302835
Returns
28312836
-------
2832-
axes : matplotlib.AxesSubplot or np.array of them
2837+
matplotlib.AxesSubplot or numpy.ndarray
2838+
Area plot generated.
2839+
2840+
See Also
2841+
--------
2842+
pandas.DataFrame.plot : Draw a plot using matplotlib.
2843+
2844+
Examples
2845+
--------
2846+
.. plot::
2847+
:context: close-figs
2848+
2849+
This example draws an area plot based on the length and width of
2850+
some animals, displayed in three bins
2851+
2852+
>>> df = pd.DataFrame({
2853+
... 'sales': [3, 2, 3, 9, 10, 6],
2854+
... 'visits': [20, 42, 28, 62, 81, 50],
2855+
... })
2856+
>>> area = df.plot.area()
28332857
"""
28342858
return self(kind='area', x=x, y=y, **kwds)
28352859

0 commit comments

Comments
 (0)