Skip to main content
MahiDev — Learn. Build. Become AI-ready.

Module 26

Seaborn

Explore tidy data with Seaborn's relational, distribution, categorical, matrix, and regression charts, then theme and finish them.

Intermediate6 hours 40 min16 lessons

01

What Is Seaborn

Meet Seaborn, the statistical plotting library built on Matplotlib: import it as sns, hand it a DataFrame and column names, and get a labelled chart.

Intermediate25 min

02

Tidy Data for Seaborn

See why Seaborn wants long-form data, one row per observation and one column per variable, and reshape wide tables with pandas melt before you plot.

Intermediate25 min

03

Scatter Plots with hue, size, and style

Draw relationships with sns.scatterplot and map more columns onto colour, marker size, and marker shape with hue, size, and style, legend included.

Intermediate25 min

04

Line Plots and Error Bands

Use sns.lineplot to draw trends, let Seaborn average repeated x values for you, and read or change the shaded band with errorbar, estimator, and hue.

Intermediate25 min

05

relplot and Small Multiples

Split one chart into a grid of small multiples with sns.relplot, using col, row, and col_wrap, and learn how figure-level functions differ from axes-level ones.

Intermediate25 min

06

Histograms with histplot

Show how one column is spread with sns.histplot: choose bins or binwidth, switch stat to percent or density, and compare groups with hue and multiple.

Intermediate25 min

07

KDE and ECDF Plots

Draw smooth density curves with sns.kdeplot, tune them with bw_adjust, compare groups, and use ecdfplot to read percentiles straight off a curve.

Intermediate25 min

08

Count Plots and Bar Plots

Count rows per category with sns.countplot, compare group means with sns.barplot, and read what the thin error bar on each bar tells you.

Intermediate25 min

09

Box Plots

Summarise a distribution in five numbers with sns.boxplot: read the box, median, whiskers, and outlier dots, and compare several groups side by side.

Intermediate25 min

10

Violin Plots

Combine a box plot with a density curve in sns.violinplot, split each violin by a second group, and choose what is drawn inside with the inner argument.

Intermediate25 min

11

Strip, Swarm, and catplot

Show every observation with sns.stripplot and sns.swarmplot, layer the dots over a box plot, and switch any categorical chart with sns.catplot.

Intermediate25 min

12

Heatmaps

Turn a grid of numbers into colour with sns.heatmap: pivot long data into rows and columns, write values with annot and fmt, and choose a fitting colour map.

Intermediate25 min

13

Regression Plots

Fit and draw a trend line with sns.regplot and sns.lmplot, read the confidence band, try a curved fit with order, and check the leftovers with residplot.

Intermediate25 min

14

Pair Plots and Joint Plots

Scan every pair of numeric columns at once with sns.pairplot, then zoom in on one pair with sns.jointplot and its histograms along both edges.

Intermediate25 min

15

Themes, Contexts, and Palettes

Change the whole look of your charts with sns.set_theme styles and contexts, and choose qualitative, sequential, or diverging colour palettes that fit the data.

Intermediate25 min

16

Customising and Saving Seaborn Charts

Finish Seaborn charts with Matplotlib: draw into subplots with ax=, set titles and limits with ax.set, move the legend, and save figure-level grids.

Intermediate25 min