Table of Contents
ToggleSeaborn builds on Matplotlib and makes it easier to create **beautiful and informative charts**. In this lesson, you’ll learn to use Seaborn for bar charts, line plots, and histograms with just a few lines of code.
import seaborn as sns
import matplotlib.pyplot as plt
tips = sns.load_dataset("tips")
sns.barplot(x="day", y="total_bill", data=tips)
plt.title("Average Bill Amount by Day")
plt.show()
Barplots help compare averages across categories.
flights = sns.load_dataset("flights")
flights_pivot = flights.pivot("month", "year", "passengers")
sns.heatmap(flights_pivot, annot=True, fmt="d")
plt.title("Monthly Flights Heatmap")
plt.show()
This heatmap is a creative way to visualize changes over time!
sns.histplot(tips["total_bill"], bins=20, kde=True)
plt.title("Distribution of Total Bills")
plt.show()
Use histograms to observe value distributions and skewness.
sns.scatterplot() for numeric column relationships.sns.countplot() to show frequency of categorical values.⏭️ Next Module: Preprocessing the data – cleaning, encoding, scaling & more!
