Skip to main content
Albero Academy

Why Matplotlib

What Matplotlib is, its place in the stack, and when to reach for it.

Foundations8 min

Matplotlib is the foundational plotting library for Python. It renders publication-quality figures from NumPy arrays and pandas data, and nearly every other Python viz tool — Seaborn, pandas .plot, scikit-learn's plotting — is built on top of it.

Its place in the stack

  • Matplotlib — the low-level engine: total control over every element.
  • Seaborn — a high-level layer on Matplotlib for statistical charts with less code.
  • pandas .plot — a convenience wrapper for quick charts from a DataFrame.

Learn Matplotlib and you understand what all of those are doing underneath — and can customise any chart they produce.

The convention

the standard import
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
plt.plot(x, np.sin(x))
plt.show()

Key takeaways

  1. 01Matplotlib is the foundational Python plotting library — most other viz tools build on it.
  2. 02It turns NumPy/pandas data into publication-quality figures with full control.
  3. 03Seaborn and pandas .plot are higher-level layers on top of Matplotlib.
  4. 04Import it as plt: import matplotlib.pyplot as plt.

Finished this chapter?

Mark it complete to track your progress through Matplotlib.