Skip to main content
Albero Academy

Box Plots

Compare distributions across categories at a glance.

Categorical Plots8 min

A boxplot summarises each category's distribution — median, quartiles (the box), whiskers and outlier points. It's the fastest way to compare distributions across groups.

boxplot

distribution per category
sns.boxplot(data=tips, x="day", y="total_bill")
sns.boxplot(data=tips, x="day", y="total_bill", hue="smoker") # grouped

Reading a box

The box spans the interquartile range (25th–75th percentile), the line inside is the median, whiskers reach to roughly the data extent, and dots beyond are outliers. Compare medians and box heights across categories at a glance.

Key takeaways

  1. 01boxplot summarises median, quartiles, whiskers and outliers per category.
  2. 02The box is the interquartile range; the inner line is the median.
  3. 03hue groups boxes side by side for a second category.
  4. 04Boxes hide distribution shape — use violins when shape matters.

Finished this chapter?

Mark it complete to track your progress through Seaborn.