@@ -3188,19 +3188,85 @@ def kde(self, bw_method=None, ind=None, **kwds):
3188
3188
3189
3189
def area (self , x = None , y = None , ** kwds ):
3190
3190
"""
3191
- Area plot
3191
+ Draw a stacked area plot.
3192
+
3193
+ An area plot displays quantitative data visually.
3194
+ This function wraps the matplotlib area function.
3192
3195
3193
3196
Parameters
3194
3197
----------
3195
- x, y : label or position, optional
3196
- Coordinates for each point.
3197
- `**kwds` : optional
3198
+ x : label or position, optional
3199
+ Index, coordinates for X axis.
3200
+ y : label or position, optional
3201
+ Index, coordinates for Y axis.
3202
+ stacked : boolean, default True
3203
+ Area plots are stacked by default. Set to False to create a
3204
+ unstacked plot.
3205
+ **kwds : optional
3198
3206
Additional keyword arguments are documented in
3199
3207
:meth:`pandas.DataFrame.plot`.
3200
3208
3201
3209
Returns
3202
3210
-------
3203
- axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them
3211
+ matplotlib.axes.Axes or numpy.ndarray
3212
+ Area plot, or array of area plots if subplots is True
3213
+
3214
+ See Also
3215
+ --------
3216
+ pandas.DataFrame.plot : Draw plots.
3217
+
3218
+ Examples
3219
+ --------
3220
+ Draw an area plot based on basic business metrics:
3221
+
3222
+ .. plot::
3223
+ :context: close-figs
3224
+
3225
+ >>> df = pd.DataFrame({
3226
+ ... 'sales': [3, 2, 3, 9, 10, 6],
3227
+ ... 'signups': [5, 5, 6, 12, 14, 13],
3228
+ ... 'visits': [20, 42, 28, 62, 81, 50],
3229
+ ... })
3230
+ >>> ax = df.plot.area()
3231
+
3232
+ Area plots are stacked by default. To produce an unstacked plot,
3233
+ pass ``stacked=False``:
3234
+
3235
+ .. plot::
3236
+ :context: close-figs
3237
+
3238
+ >>> df = pd.DataFrame({
3239
+ ... 'sales': [3, 2, 3, 9, 10, 6],
3240
+ ... 'signups': [5, 5, 6, 12, 14, 13],
3241
+ ... 'visits': [20, 42, 28, 62, 81, 50],
3242
+ ... })
3243
+ >>> ax = df.plot.area(stacked=False)
3244
+
3245
+ Draw an area plot for each metric:
3246
+
3247
+ .. plot::
3248
+ :context: close-figs
3249
+
3250
+ >>> df = pd.DataFrame({
3251
+ ... 'sales': [3, 2, 3, 9, 10, 6],
3252
+ ... 'signups': [5, 5, 6, 12, 14, 13],
3253
+ ... 'visits': [20, 42, 28, 62, 81, 50],
3254
+ ... })
3255
+ >>> ax = df.plot.area(y='sales')
3256
+ >>> ax = df.plot.area(y='signups')
3257
+ >>> ax = df.plot.area(y='visits')
3258
+
3259
+ Draw with a different `x`:
3260
+
3261
+ .. plot::
3262
+ :context: close-figs
3263
+
3264
+ >>> df = pd.DataFrame({
3265
+ ... 'sales': [3, 2, 3],
3266
+ ... 'visits': [20, 42, 28],
3267
+ ... 'day': ['Monday', 'Tuesday', 'Wednesday'],
3268
+ ... })
3269
+ >>> ax = df.plot.area(x='day')
3204
3270
"""
3205
3271
return self (kind = 'area' , x = x , y = y , ** kwds )
3206
3272
0 commit comments