A minimalist, interactive guide to mastering Matplotlib and Seaborn. Learn to bridge the gap between raw numbers and human understanding.
"The greatest value of a picture is when it forces us to notice what we never expected to see."
— John Tukey
Spot trends and correlations hidden in spreadsheets.
Simplify complex datasets for faster comprehension.
Engage stakeholders with compelling data narratives.
The foundation of Python visualization. Think of
pyplot as your digital paintbrush.
The simplest way to show trends over time. We map two lists: one for the X-axis (Years) and one for the Y-axis (Performance).
import matplotlib.pyplot as plt
years = [1990, 1992, 1994, 1996]
runs = [500, 700, 1100, 1500]
plt.plot(years, runs, 'ro--') # Red circles, dashed line
plt.xlabel("Year")
plt.ylabel("Runs")
plt.show()
Bar charts excel at comparing discrete quantities. Use width to control spacing and
xticks to label categories correctly.
players = ["Sachin", "Sehwag", "Kohli"]
runs = [1500, 1200, 1800]
plt.bar(players, runs,
color="skyblue",
edgecolor='black')
# Add value labels
for i in range(len(players)):
plt.text(i, runs[i] + 50,
str(runs[i]),
ha='center')
Choose the right tool for your data story.
Distribution Analysis
Use bins to control grouping. Essential for spotting
outliers and skewness.
Part-to-Whole
Best for 3-6 categories. Use explode to highlight
specific slices.
Correlation
Reveals relationships between two variables. Use color and size for extra dimensions.
import seaborn as sns
import matplotlib.pyplot as plt
# Load example dataset
tips = sns.load_dataset("tips")
# One line for a beautiful plot
sns.scatterplot(data=tips,
x="total_bill",
y="tip",
hue="time")
plt.show()
Matplotlib gives you control, but Seaborn gives you beauty and speed. Built on top of Matplotlib, it integrates seamlessly with Pandas DataFrames.
sns.set_theme().
This page is fully interactive. Try hovering over the charts, clicking the tabs in the "Philosophy" section, or clicking the replay buttons on the code examples.