tml)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ DataFrame ](../frame.html)
  * pandas.DataF... 

#  pandas.DataFrame.plot.area  #

DataFrame.plot.  area  (  _ x  =  None  _ , _ y  =  None  _ , _ stacked  =
True  _ , _ **  kwargs  _ )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/plotting/_core.py#L1526-L1603) #

    

Draw a stacked area plot.

An area plot displays quantitative data visually. This function wraps the
matplotlib area function.

Parameters  :

    

**x** label or position, optional

    

Coordinates for the X axis. By default uses the index.

**y** label or position, optional

    

Column to plot. By default uses all columns.

**stacked** bool, default True

    

Area plots are stacked by default. Set to False to create a unstacked plot.

****kwargs**

    

Additional keyword arguments are documented in [ ` DataFrame.plot()  `
](pandas.DataFrame.plot.html#pandas.DataFrame.plot "pandas.DataFrame.plot") .

Returns  :

    

matplotlib.axes.Axes or numpy.ndarray

    

Area plot, or array of area plots if subplots is True.

See also

[ ` DataFrame.plot  ` ](pandas.DataFrame.plot.html#pandas.DataFrame.plot
"pandas.DataFrame.plot")

    

Make plots of DataFrame using matplotlib / pylab.

Examples

Draw an area plot based on basic business metrics:

    
    
    >>> df = pd.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='ME'))
    >>> ax = df.plot.area()
    

![../../_images/pandas-DataFrame-plot-area-1.png](../../_images/pandas-
DataFrame-plot-area-1.png)

Area plots are stacked by default. To produce an unstacked plot, pass `
stacked=False  ` :

    
    
    >>> ax = df.plot.area(stacked=False)
    

![../../_images/pandas-DataFrame-plot-area-2.png](../../_images/pandas-
DataFrame-plot-area-2.png)

Draw an area plot for a single column:

    
    
    >>> ax = df.plot.area(y='sales')
    

![../../_images/pandas-DataFrame-plot-area-3.png](../../_images/pandas-
DataFrame-plot-area-3.png)

Draw with a different  x  :

    
    
    >>> df = pd.DataFrame({
    ...     'sales': [3, 2, 3],
    ...     'visits': [20, 42, 28],
    ...     'day': [1, 2, 3],
    ... })
    >>> ax = df.plot.area(x='day')
    

![../../_images/pandas-DataFrame-plot-area-4.png](../../_images/pandas-
DataFrame-plot-area-4.png)

[ __ previous  pandas.DataFrame.plot  ](pandas.DataFrame.plot.html "previous
page") [ next  pandas.DataFrame.plot.bar  __ ](pandas.DataFrame.plot.bar.html
"next page")

__ On this page

  * ` DataFrame.plot.area()  `

[ __ Show Source
](../../_sources/reference/api/pandas.DataFrame.plot.area.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.