Dataslope logoDataslope

Box Plots

A compact summary of a distribution — median, quartiles, and outliers in a single shape

A box plot (or box-and-whisker plot) is a compact way to summarize a numeric distribution. Unlike a histogram, which shows every bin, a box plot reduces the distribution to a handful of key summary statistics — and that compactness lets you compare many distributions side by side without clutter.

Anatomy of a box plot

The box itself spans from Q1 (25th percentile) to Q3 (75th percentile). The line inside is the median. The "whiskers" extend to the most extreme non-outlier values, and dots beyond them are individually drawn outliers.

A box thus shows you, at a glance:

  • Center (median).
  • Spread (box height = interquartile range, or IQR).
  • Skew (median position inside the box, whisker asymmetry).
  • Outliers (individual dots).

In one compact glyph.

A first box plot

Code Block
Python 3.13.2

Hover over the box — Plotly shows you the median, Q1, Q3, min, max, and lists each outlier. That's a lot of summary in one shape.

Comparing groups: side by side

The real power of box plots is side-by-side comparison. Add an x="..." and you get one box per category:

Code Block
Python 3.13.2

Now you can compare eight distributions at once: 4 days × 2 sexes. Try this with histograms and you'd need eight separate subplot panels.

Show every point with points="all"

When sample sizes are small, the summary may hide too much. Add the raw points back:

Code Block
Python 3.13.2

This hybrid (box + jittered dots) is sometimes the best of both worlds: summary and raw data.

Violin plots: when shape matters

Box plots hide the shape of the distribution. A violin plot shows the same summary plus a smoothed density:

Code Block
Python 3.13.2

Violins reveal bimodality, skew shape, and other features that a plain box would hide. They cost a bit more visual complexity, but they're often worth it.

When to use box plots vs histograms vs violins

QuestionBest chart
What does this one variable look like?Histogram
How do many groups compare in their distribution summary?Box plot
How do many groups compare in their distribution shape?Violin plot
Where are the individual points?Strip plot, or box with points="all"

Reading box plots: a few traps

  • Box plots can hide bimodality. A bimodal distribution and a uniform distribution can look identical as boxes. If you suspect weird shape, switch to a violin or histogram.
  • Outlier dots ≠ "errors." A point beyond the whiskers is just beyond ~1.5×IQR from the box. It may be legitimate data.
  • For very small n (e.g., 5 rows per group) the summary becomes meaningless. Show the raw points instead.

Check your understanding

QuestionSelect one

What does the box in a box plot represent?

The range of all values.

The mean ± one standard deviation.

The interquartile range — from Q1 (25th percentile) to Q3 (75th percentile), with the median line inside.

The standard error of the mean.

QuestionSelect one

What is a key strength of box plots over histograms?

Box plots show more detail about distribution shape.

Box plots always look prettier.

Box plots are compact enough to compare many distributions side by side without visual overload.

Box plots are always more accurate.

QuestionSelect one

A distribution is bimodal (two peaks). How might it look on a box plot vs a violin plot?

Identical on both.

A clear bimodal shape on the box; flat on the violin.

Featureless on the box plot (the box can't show two peaks), but clearly bimodal on the violin plot.

The box would have two medians.

QuestionSelect one

The dots beyond a box plot's whiskers are commonly called outliers. Are they always errors in the data?

Yes, always.

Yes, unless the chart says otherwise.

No — a dot beyond the whiskers is simply a value more than ~1.5×IQR from the box. It may be a real, legitimate observation.

No, only if the chart is wrong.

On this page