Skip to content

Facet Grids

Facet grids create small multiples:

  • The same plot repeated for different subgroups
  • Helps compare patterns across segments

Examples:

  • Distribution by gender
  • Trend by region
  • Relationship by category
diagram How a facet grid is laid out mermaid
One category maps to columns, another (optional) maps to rows, and the same plot type is repeated in every cell.
Facet distribution
import seaborn as sns
 
tips = sns.load_dataset("tips")
 
sns.displot(data=tips, x="total_bill", col="time", bins=20, kde=True)
Facet relationship
import seaborn as sns
 
tips = sns.load_dataset("tips")
 
sns.relplot(data=tips, x="total_bill", y="tip", col="time", hue="sex")
FacetGrid
import seaborn as sns
import matplotlib.pyplot as plt
 
tips = sns.load_dataset("tips")
 
g = sns.FacetGrid(tips, col="time", row="sex")
g.map_dataframe(sns.scatterplot, x="total_bill", y="tip")
 
plt.tight_layout()

Each small panel is the same chart type, just filtered to one combination of row/column categories — easy to compare shapes side by side:

sketch A facet grid of small multiples p5.js
Each cell repeats the same chart type for one row/column combination, making side-by-side comparison easy.
  • Facets can get crowded—keep category counts small.
  • Facets are excellent for storytelling and comparisons.

This wraps up the Seaborn phase — revisit the Phase Overview to see how all these lessons connect, or move on to the next module.

Exercise 1 – Facet a Distribution by Column

Section titled “Exercise 1 – Facet a Distribution by Column”

Exercise 3 – Map a Plot Function onto the Grid

Section titled “Exercise 3 – Map a Plot Function onto the Grid”

pch.coffeeTagline

pch.coffeeCta

pch.feedbackHeading

pch.feedbackSubheading