Skip to content

Pair Plots

Pair plots are a fast way to inspect:

  • Pairwise relationships between variables
  • Distributions on the diagonal
  • Group separation using hue

They are great early in EDA.

diagram How pairplot fills a grid mermaid
pairplot builds an n×n grid: scatter plots off the diagonal, a distribution plot on the diagonal.
pairplot
import seaborn as sns
 
penguins = sns.load_dataset("penguins").dropna()
 
sns.pairplot(penguins[[
    "bill_length_mm",
    "bill_depth_mm",
    "flipper_length_mm",
    "body_mass_g",
]])
pairplot with hue
import seaborn as sns
 
penguins = sns.load_dataset("penguins").dropna()
 
sns.pairplot(
    penguins,
    vars=["bill_length_mm", "bill_depth_mm", "flipper_length_mm", "body_mass_g"],
    hue="species",
)
  • Pair plots can be slow for large datasets. Sample rows if needed.
  • Use hue to check if groups separate naturally.

Continue to Facet Grids to split any plot type into small multiples by category.

pch.coffeeTagline

pch.coffeeCta

pch.feedbackHeading

pch.feedbackSubheading