How to read and make a box plot (quartiles, whiskers, outliers)
A box plot shows the median, quartiles, spread and outliers of a data set in one compact figure. Because it does not rely on the mean and SD, it suits skewed data, data with outliers, and results of nonparametric tests. But the definition of the whiskers and the way quartiles are computed differ between programs, so unless the legend says which, readers may misread it.
The parts of a box plot
- Centre line: the median (middle value)
- Box: from the first quartile (25%) to the third quartile (75%); it holds the middle 50% of values. Its height is the interquartile range (IQR)
- Whiskers: in the most common (Tukey) definition, they reach the most extreme data point within 1.5 × IQR of the box
- Points: values beyond the whiskers (drawn as outliers). Some plots overlay every data point
If the median line sits towards one end of the box, or the whiskers are of unequal length, the distribution is skewed. If two boxes barely overlap, the distributions clearly differ.
Example: computing it from 12 values
Diameters of 12 cells (µm, made up), in order:
12.1, 13.4, 14, 14.2, 14.8, 15.1, 15.5, 15.9, 16.3, 17, 17.6, 24.5
| Value | Calculation | Result |
|---|---|---|
| Median | Average of the 6th and 7th values, (15.1 + 15.5)/2 | 15.3 |
| First quartile Q1 | Position (12 − 1) × 0.25 + 1 = 3.75: 14.0 + 0.75 × (14.2 − 14.0) | 14.15 |
| Third quartile Q3 | Position (12 − 1) × 0.75 + 1 = 9.25: 16.3 + 0.25 × (17.0 − 16.3) | 16.475 |
| IQR | Q3 − Q1 | 2.325 |
| Whisker limits (fences) | Q1 − 1.5 × IQR to Q3 + 1.5 × IQR | 10.66 to 19.96 |
| Whisker ends | Smallest and largest data inside the fences | 12.1 and 17.6 |
| Outliers (points) | Data outside the fences | 24.5 |
24.5 is above the upper fence of 19.96, so the whisker stops at 17.6 and 24.5 is drawn as a point. That one value pulls the mean (15.87) above the median (15.3) and inflates the SD to 3.12.
Quartiles differ between programs
There are at least nine definitions of sample quantiles (Hyndman and Fan’s types 1 to 9), so the same data can give slightly different Q1 and Q3 in different software. The smaller n, the bigger the difference.
| Method | Where it is used | Q1 | Q3 |
|---|---|---|---|
| Linear interpolation (type 7, position (n − 1)p + 1) | R quantile() and ggplot2 box plots, numpy default, Excel QUARTILE.INC, BenchFig | 14.15 | 16.475 |
| Position (n + 1)p (type 6) | Excel QUARTILE.EXC, SPSS percentiles by default (its Explore box plots use Tukey’s hinges), Minitab and others | 14.05 | 16.825 |
| Tukey’s hinges (medians of the lower and upper halves) | R boxplot() (fivenum), Tukey’s original definition | 14.1 | 16.65 |
Even within R, quantile() and boxplot() can disagree. None is “the” correct one; naming your software in the paper is enough, but remember these differences when comparing figures made with different programs.
Whisker definitions vary too
| Whisker definition | Notes |
|---|---|
| Most extreme data within 1.5 × IQR of the quartiles (Tukey) | The most common. Shows outliers as points. BenchFig uses this definition |
| Minimum to maximum | No outlier points; a single extreme value stretches the whisker |
| 10th–90th or 5th–95th percentiles, etc. | Used with large n; values outside are usually drawn as points |
The definition changes how the figure looks, so always state it in the legend. If you just write “whiskers”, readers may assume minimum to maximum.
Box plot, bar graph or points + median?
- Bars with error bars: show mean and SD/SEM. Fit near-normal data and t tests or ANOVA. They hide the distribution, so overlay the points (choosing error bars).
- Box plot: shows median and quartiles. Fits skewed data, outliers, and nonparametric tests such as Mann–Whitney or Kruskal–Wallis (Mann–Whitney U test).
- Points with median and IQR: with small n (about 5 to 10), individual points and a median line are more honest than a box.
How to describe it in a paper
State in the legend what the box, center line, whiskers and points show, and n. For example: “Boxes show the interquartile range, center lines the median, and whiskers extend to the most extreme values within 1.5 × IQR of the quartiles; points beyond the whiskers are plotted individually. n = 12.” BenchFig writes this sentence for you in the Methods text, matching the graph type you chose.
FAQ
Does an “outlier” in a box plot mean I can delete it?
No. The points only highlight values beyond the whiskers (more than 1.5 × IQR from the quartiles); they do not mean the values may be removed. Exclude data only for experimental reasons such as a failed measurement, and report the rule and how many were excluded.
Can I use a box plot with a small n?
You can draw one, but with n ≈ 5 the quartiles depend on one or two values and the box is unstable. With small n, plot every point or use points with the median; if you use a box plot, overlay the points.
Can I add the mean to a box plot?
Some people do (a “+” or “×” marker). A box plot is rank-based, so if you add the mean, say so in the legend. A large gap between mean and median signals a skewed distribution.
How is it different from a violin plot?
A violin plot draws the distribution’s shape (density) as a mirrored outline and can reveal, for example, two peaks. A box plot shows only a five-number summary. Both can mislead with small n, so overlaying the points is the safe choice.
Related guides
Product and journal names are trademarks or registered trademarks of their respective owners.