<jupyter_start><jupyter_text>New to Plotly?Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/).You can set up Plotly to work in [online](https://plot.ly/python/getting-started/initialization-for-online-plotting) or [offline](https://plot.ly/python/getting-started/initialization-for-offline-plotting) mode, or in [jupyter notebooks](https://plot.ly/python/getting-started/start-plotting-online).We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!  Version CheckPlotly's python package is updated frequently. Run `pip install plotly --upgrade` to use the latest version.<jupyter_code>import plotly
plotly.__version__<jupyter_output><empty_output><jupyter_text>Area Plot<jupyter_code>import plotly.plotly as py
import plotly.tools as tls

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.plot([2,1,3,1,2])

update = {'data':[{'fill': 'tozeroy'}]}  # this updates the trace
plotly_fig = tls.mpl_to_plotly( fig )
plotly_fig.update(update)
py.iplot(plotly_fig, update=update, filename='mpl-basic-area')<jupyter_output><empty_output><jupyter_text>Multiple Line Area Plot<jupyter_code>import plotly.plotly as py
import plotly.tools as tls

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0, 2*np.pi, 100)
fig, ax = plt.subplots()
ax.plot(np.sin(x), label='sin'); ax.plot(np.cos(x), label='cos')

update = {'data':[{'fill': 'tozeroy'}]}  # this updates BOTH traces now
plotly_fig = tls.mpl_to_plotly( fig )
plotly_fig.update(update)
py.iplot(plotly_fig, filename='mpl-multi-fill')<jupyter_output><empty_output><jupyter_text>Stacked Line Plot<jupyter_code>import plotly.plotly as py
import plotly.tools as tls

import numpy as np
import matplotlib.pyplot as plt

# create our stacked data manually
y0 = np.random.rand(100)
y1 = y0 + np.random.rand(100)
y2 = y1 + np.random.rand(100)
capacity = 3*np.ones(100)

# make the mpl plot (no fill yet)
fig, ax = plt.subplots()
ax.plot(y0, label='y0')
ax.plot(y1, label='y1')
ax.plot(y2, label='y2')
ax.plot(capacity, label='capacity')

# set all traces' "fill" so that it fills to the next 'y' trace
update = {'data':[{'fill': 'tonexty'}]}

# strip style just lets Plotly make the styling choices (e.g., colors)
plotly_fig = tls.mpl_to_plotly( fig )
plotly_fig.update(update)
py.iplot(plotly_fig, strip_style=True, filename='mpl-stacked-line')<jupyter_output><empty_output><jupyter_text>ReferenceSee https://plot.ly/python/reference/ for more information and chart attribute options!<jupyter_code>from IPython.display import display, HTML

display(HTML('<link href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Inconsolata|Ubuntu+Mono:400,700" rel="stylesheet" type="text/css" />'))
display(HTML('<link rel="stylesheet" type="text/css" href="http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css">'))

! pip install git+https://github.com/plotly/publisher.git --upgrade
import publisher
publisher.publish(
    'matplotlib_area.ipynb', 'matplotlib/filled-area-plots/', 'Filled Area Plots',
    'How to make a filled area plot in matplotlib. An area chart displays a solid color between the traces of a graph.',
    title = 'Matplotlib Filled Area Plots | Plotly',
    has_thumbnail='true', thumbnail='thumbnail/area.jpg',
    language='matplotlib',
    page_type='example_index',
    display_as='basic', ipynb='~notebook_demo/246')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14170826400443706, 'fraction_numerical': 0.015252357182473655, 'mean_word_length': 6.031189083820663, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '171469', 'license': 'CC-BY-3.0', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1260, 'n_words': 288, 'path': '_posts/matplotlib/area/matplotlib_area.ipynb', 'repo_name': 'bmb804/documentation', 'size': '3606'}