pyspark.pandas.Series.plot.area#
- plot.area(x=None, y=None, **kwds)#
Draw a stacked area plot.
An area plot displays quantitative data visually. This function wraps the plotly area function.
- Parameters
- xlabel or position, optional
Coordinates for the X axis. By default it uses the index.
- ylabel or position, optional
Column to plot. By default it uses all columns.
- stackedbool, default True
Area plots are stacked by default. Set to False to create an unstacked plot (matplotlib-only).
- **kwdsoptional
Additional keyword arguments are documented in
DataFrame.plot()
.
- Returns
plotly.graph_objs.Figure
Return an custom object when
backend!=plotly
. Return an ndarray whensubplots=True
(matplotlib-only).
Examples
For Series
>>> df = ps.DataFrame({ ... 'sales': [3, 2, 3, 9, 10, 6], ... 'signups': [5, 5, 6, 12, 14, 13], ... 'visits': [20, 42, 28, 62, 81, 50], ... }, index=pd.date_range(start='2018/01/01', end='2018/07/01', ... freq='M')) >>> df.sales.plot.area()
For DataFrame
>>> df = ps.DataFrame({ ... 'sales': [3, 2, 3, 9, 10, 6], ... 'signups': [5, 5, 6, 12, 14, 13], ... 'visits': [20, 42, 28, 62, 81, 50], ... }, index=pd.date_range(start='2018/01/01', end='2018/07/01', ... freq='M')) >>> df.plot.area()