Plot guides › Chart types

Area chart

An area chart is a line chart with the space underneath filled in. The fill stresses magnitude, such as cumulative users or stored energy, more than a bare line does.

Example area chart made with matplotlib
Rendered from the code below, with example data.

When to use it

Ask for it in pltchat

Upload your file and type something like:

"area chart of daily active users"

pltchat writes the loader and the plot for your columns, runs it in your browser and shows you the code.

The matplotlib code

Self-contained with example data; swap in pd.read_csv(...) or pd.read_excel(...) for your own file.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

rng = np.random.default_rng(15)
days = pd.date_range("2024-01-01", periods=180)
users = 1000 + np.cumsum(rng.normal(8, 30, days.size))
users += 150 * (days.day_of_week < 5)

fig, ax = plt.subplots(figsize=(6.4, 4))
ax.fill_between(days, users, alpha=0.4)
ax.plot(days, users, lw=1)
ax.set_ylim(bottom=0)
ax.set_ylabel("Daily active users")
fig.autofmt_xdate()
plt.tight_layout()
plt.show()

Make this with your data

Upload a CSV, Excel, JSON or Parquet file. Your first plot is always free.

Related plots