@@ -3337,19 +3337,85 @@ def kde(self, bw_method=None, ind=None, **kwds):
3337
3337
3338
3338
def area (self , x = None , y = None , ** kwds ):
3339
3339
"""
3340
- Area plot
3340
+ Draw a stacked area plot.
3341
+
3342
+ An area plot displays quantitative data visually.
3343
+ This function wraps the matplotlib area function.
3341
3344
3342
3345
Parameters
3343
3346
----------
3344
- x, y : label or position, optional
3345
- Coordinates for each point.
3346
- `**kwds` : optional
3347
+ x : label or position, optional
3348
+ Index, coordinates for X axis.
3349
+ y : label or position, optional
3350
+ Index, coordinates for Y axis.
3351
+ stacked : boolean, default True
3352
+ Area plots are stacked by default. Set to False to create a
3353
+ unstacked plot.
3354
+ **kwds : optional
3347
3355
Additional keyword arguments are documented in
3348
3356
:meth:`pandas.DataFrame.plot`.
3349
3357
3350
3358
Returns
3351
3359
-------
3352
- axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them
3360
+ matplotlib.axes.Axes or numpy.ndarray
3361
+ Area plot, or array of area plots if subplots is True
3362
+
3363
+ See Also
3364
+ --------
3365
+ pandas.DataFrame.plot : Draw plots.
3366
+
3367
+ Examples
3368
+ --------
3369
+ Draw an area plot based on basic business metrics:
3370
+
3371
+ .. plot::
3372
+ :context: close-figs
3373
+
3374
+ >>> df = pd.DataFrame({
3375
+ ... 'sales': [3, 2, 3, 9, 10, 6],
3376
+ ... 'signups': [5, 5, 6, 12, 14, 13],
3377
+ ... 'visits': [20, 42, 28, 62, 81, 50],
3378
+ ... })
3379
+ >>> ax = df.plot.area()
3380
+
3381
+ Area plots are stacked by default. To produce an unstacked plot,
3382
+ pass ``stacked=False``:
3383
+
3384
+ .. plot::
3385
+ :context: close-figs
3386
+
3387
+ >>> df = pd.DataFrame({
3388
+ ... 'sales': [3, 2, 3, 9, 10, 6],
3389
+ ... 'signups': [5, 5, 6, 12, 14, 13],
3390
+ ... 'visits': [20, 42, 28, 62, 81, 50],
3391
+ ... })
3392
+ >>> ax = df.plot.area(stacked=False)
3393
+
3394
+ Draw an area plot for each metric:
3395
+
3396
+ .. plot::
3397
+ :context: close-figs
3398
+
3399
+ >>> df = pd.DataFrame({
3400
+ ... 'sales': [3, 2, 3, 9, 10, 6],
3401
+ ... 'signups': [5, 5, 6, 12, 14, 13],
3402
+ ... 'visits': [20, 42, 28, 62, 81, 50],
3403
+ ... })
3404
+ >>> ax = df.plot.area(y='sales')
3405
+ >>> ax = df.plot.area(y='signups')
3406
+ >>> ax = df.plot.area(y='visits')
3407
+
3408
+ Draw with a different `x`:
3409
+
3410
+ .. plot::
3411
+ :context: close-figs
3412
+
3413
+ >>> df = pd.DataFrame({
3414
+ ... 'sales': [3, 2, 3],
3415
+ ... 'visits': [20, 42, 28],
3416
+ ... 'day': ['Monday', 'Tuesday', 'Wednesday'],
3417
+ ... })
3418
+ >>> ax = df.plot.area(x='day')
3353
3419
"""
3354
3420
return self (kind = 'area' , x = x , y = y , ** kwds )
3355
3421
0 commit comments