Skip to content

Commit 49c6abb

Browse files
DOC: fixes to DataFrame.plot.area docstring (#22307)
1 parent ffae158 commit 49c6abb

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

pandas/plotting/_core.py

+3-16
Original file line numberDiff line numberDiff line change
@@ -3385,25 +3385,13 @@ def area(self, x=None, y=None, **kwds):
33853385
.. plot::
33863386
:context: close-figs
33873387
3388-
>>> df = pd.DataFrame({
3389-
... 'sales': [3, 2, 3, 9, 10, 6],
3390-
... 'signups': [5, 5, 6, 12, 14, 13],
3391-
... 'visits': [20, 42, 28, 62, 81, 50],
3392-
... }, index=pd.date_range(start='2018/01/01', end='2018/07/01',
3393-
... freq='M'))
33943388
>>> ax = df.plot.area(stacked=False)
33953389
3396-
Draw an area plot for each metric:
3390+
Draw an area plot for a single column:
33973391
33983392
.. plot::
33993393
:context: close-figs
34003394
3401-
>>> df = pd.DataFrame({
3402-
... 'sales': [3, 2, 3, 9, 10, 6],
3403-
... 'signups': [5, 5, 6, 12, 14, 13],
3404-
... 'visits': [20, 42, 28, 62, 81, 50],
3405-
... }, index=pd.date_range(start='2018/01/01', end='2018/07/01',
3406-
... freq='M'))
34073395
>>> ax = df.plot.area(y='sales')
34083396
34093397
Draw with a different `x`:
@@ -3414,9 +3402,8 @@ def area(self, x=None, y=None, **kwds):
34143402
>>> df = pd.DataFrame({
34153403
... 'sales': [3, 2, 3],
34163404
... 'visits': [20, 42, 28],
3417-
... 'day': ['Monday', 'Tuesday', 'Wednesday'],
3418-
... }, index=pd.date_range(start='2018/01/01', end='2018/07/01',
3419-
... freq='M'))
3405+
... 'day': [1, 2, 3],
3406+
... })
34203407
>>> ax = df.plot.area(x='day')
34213408
"""
34223409
return self(kind='area', x=x, y=y, **kwds)

0 commit comments

Comments
 (0)