Nº28 · Visualization
seaborn
Elegant statistical charts in one line, on top of Matplotlib.
What is it?
seaborn is a Python statistical visualization library built on top of Matplotlib: it produces pretty, complex charts —distributions, correlations, regressions— with very little code. It's integrated with pandas DataFrames, so you usually hand it your tabular data directly and name the columns to plot.
Instead of assembling the figure element by element as in Matplotlib, you ask for a kind of statistical chart and seaborn handles the rest: palette, axes, aggregation and style. Because it lives on top of Matplotlib, whenever you want to tweak something you can always drop down to its API.
What is it for?
- Fast EDA. Explore the distribution of a variable or the relationship between two in one line, without fighting the styling.
- Correlation heatmaps. Visualize a correlation matrix to spot which variables move together.
- Pairplots. Cross every variable in a DataFrame against the others in one shot for a panoramic view.
- Presentation-ready charts. Polished results by default —curated palettes and themes— that work for both analysis and a report.
When to use it / when not
Use it for quick, pretty statistical visualization over tabular data: EDA in notebooks, distributions, correlations and regressions in a few lines.
Think twice for:
- Millimeter control over the figure: drop down to Matplotlib —seaborn uses it underneath, so you lose nothing and gain precision.
- Interactive dashboards others explore on their own in the browser: a BI tool like Superset fits better; seaborn produces static images, not apps.
- Web interactivity (zoom, hover, tooltips): Plotly is built for that.
Get started in 1 minute
Install seaborn and draw a statistical chart using one of its example datasets:
pip install seaborn
import seaborn as sns
import matplotlib.pyplot as plt
tips = sns.load_dataset("tips") # bundled example dataset
sns.scatterplot(data=tips, x="total_bill", y="tip")
plt.show() # in a notebook it appears under the cell
# sns.histplot(data=tips, x="total_bill") # or a distribution in one line
Quick trivia — test what you just read.
How much do you know about seaborn?
Official documentation
The source of truth lives there. Here we orient you; the depth is up to you.
Open official docs ↗What to learn next
See alsoNº28 · Updated 2026-06-26