Lesson 14 · Data analytics zero to hero
Beautiful Charts with Seaborn in Python | Data Analytics #14
Video fourteen of the 30-part series: Seaborn, a higher-level charting library built directly on top of Matplotlib, for faster, more polished statistical…
- CourseData analytics zero to hero
- Lesson14 of 30
- Video12 min
- FormatJupyter notebook · 10 code cells
- Data1 dataset
What you'll learn
Datasets used in this lesson
Save these next to the notebook. In Google Colab, upload them with the 📁 icon on the left first.
- iris.csv3.8 KB
📓 Full notebook
Download .ipynbData Analytics Zero to Hero, Video 14: Data Visualization with Seaborn#
- Video fourteen of the 30-part series: Seaborn, a higher-level charting library built directly on top of Matplotlib, for faster, more polished statistical charts.
- We're using the real Iris dataset, Ronald Fisher's classic 1936 flower measurements, one of the most famous real datasets in all of statistics.
- Let's jump straight in.
Before You Start#
- Open a new Jupyter Notebook in VS Code and select your Python interpreter as the kernel.
- Install Seaborn if you haven't already:
pip install seaborn. - Place iris.csv in the same folder as this notebook.
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_csv('iris.csv')
print(df.shape)
print(df.head(3))
Part 1: scatterplot with hue#
sns.scatterplot(data=df, x='petal_length', y='petal_width', hue='species')
plt.title('Real Petal Length vs. Width, by Species')
plt.show()
Part 2: Distributions with histplot and kdeplot#
sns.histplot(data=df, x='sepal_length', hue='species', kde=True)
plt.title('Real Sepal Length Distribution, by Species')
plt.show()
sns.kdeplot(data=df, x='petal_length', hue='species', fill=True)
plt.title('Real Petal Length Density, by Species')
plt.show()
Part 3: boxplot and violinplot#
sns.boxplot(data=df, x='species', y='petal_length')
plt.title('Real Petal Length by Species')
plt.show()
sns.violinplot(data=df, x='species', y='sepal_width')
plt.title('Real Sepal Width by Species')
plt.show()
Part 4: pairplot#
sns.pairplot(df, hue='species')
plt.show()
Part 5: Correlation Heatmap#
numeric_df = df.drop(columns='species')
corr = numeric_df.corr()
print(corr.round(2))
sns.heatmap(corr, annot=True, cmap='coolwarm', center=0)
plt.title('Real Correlation Between Iris Measurements')
plt.show()
A Note on Styling#
sns.set_theme(style='whitegrid')
sns.scatterplot(data=df, x='sepal_length', y='sepal_width', hue='species')
plt.title('Themed Real Scatter Plot')
plt.show()
Wrap-Up: What You Learned#
- scatterplot with hue, for fast, automatically colored and legended scatter plots.
- histplot and kdeplot, for visualizing distributions, split by category.
- boxplot and violinplot, for comparing a numeric column across categories.
- pairplot, for surveying every numeric relationship in a dataset in one call.
- A correlation heatmap, for scanning relationships between many columns at once.
- set_theme, for a consistent, polished look across every chart.
- All of it on the real, famous Iris dataset. This wraps up the visualization block. Video fifteen builds an interactive dashboard with Streamlit, turning charts like these into a real shareable app. Subscribe so it lands automatically see you there.
Found this useful?
All lessons, notebooks and datasets here are free. If they helped you, a coffee keeps new lessons coming.



