A box plot summarises the centre and spread of an ordered numerical dataset. Its box marks the first and third quartiles, and a line inside marks the median. Whiskers and separately plotted observations add information about the tails.

There is more than one box-plot convention. Some plots extend whiskers to the minimum and maximum. This page uses a modified box plot, with whiskers ending at observed values within 1.5 IQR fences and values strictly beyond the fences shown separately. State the convention rather than expecting the reader to infer it.

On this page

Calculate the summaries before drawing

Use the synthetic journey times, in minutes:

8,10,12,12,14,16,18,20,22,48.8,10,12,12,14,16,18,20,22,48.

Under the median-of-halves convention defined in Quartiles and Interquartile Range, the quartiles are Q1=12Q_1=12, median =15=15 and Q3=20Q_3=20. The minimum is 8 and maximum 48. These five numbers form the ordinary five-number summary.

The IQR is 20−12=820-12=8, and the inner fences are

12−1.5(8)=0,20+1.5(8)=32.12-1.5(8)=0,\qquad20+1.5(8)=32.

The maximum is beyond the upper fence. It remains in the dataset but is shown as a separate point.

Put the whiskers at observations, not fences

The lower whisker ends at 8, the smallest observed value within the fences. The upper whisker ends at 22, the largest observed value within them. Neither whisker extends to the fence itself unless an observation happens to fall there.

The same IQR can accompany different tails

Compare two modified box plotsTwo synthetic samples of ten journey times share the same scale. Group A has one point beyond the upper whisker; Group B has none.01020304050Modified box plots, n = 10 in each groupJourney time (minutes)AB48
Both samples are synthetic. Whiskers end at actual unflagged observations, not automatically at the fence.
Diagram explanation and exact data

Group A has Q1 12, median 15 and Q3 20, with whiskers at 8 and 22 and an outlier at 48. Group B has Q1 14, median 17 and Q3 22, with whiskers at 10 and 26. Both IQRs are 8, but the full distributions differ.

The same IQR can accompany different tails: exact reference data
Group n Lower whisker Q1 Median Q3 Upper whisker Separate point
A 10 8 12 15 20 22 48
B 10 10 14 17 22 26 None

The box therefore runs from 12 to 20, with a median line at 15. The whiskers connect the box to 8 and 22. A separate point marks 48. This plot uses all ten observations; the distinct point does not mean the largest observation was discarded.

Statistics Canada’s box-plot introduction connects this kind of display with ordered summaries. The exact whisker and quantile rules used here are stated explicitly so the calculations and figure can be reproduced.

Read the lengths correctly

A long part of a box represents a wide interval of values, not automatically more observations. Quartile sections divide positions in the ordered data, with ties and finite-sample conventions affecting exact counts.

In the example, the interval from Q1=12Q_1=12 to the median 15 is three minutes wide; the interval from the median to Q3=20Q_3=20 is five minutes wide. That describes unequal spacing in values. It does not imply that the upper half of the box contains 5/35/3 times as many observations.

Likewise, the visual length of a whisker does not directly reveal the number of points in it. A very long whisker can represent relatively few observations.

Compare two distributions

Consider a second synthetic group with ten values:

10,12,14,14,16,18,20,22,24,26.10,12,14,14,16,18,20,22,24,26.

Its first quartile is 14, median 17 and third quartile 22. The IQR is again 8. Its fences are 2 and 34, so the whiskers reach the observed minimum 10 and maximum 26, with no flagged points.

The second group has a median two minutes higher than the first, while both have IQR 8. The first group has a much longer overall range because of 48. These are descriptive comparisons of the supplied datasets, not a test of a population difference.

Use the same axis scale and show each sample size. The boxes can be vertically separated, but changing the horizontal scale between groups would make their widths incomparable.

What a box plot leaves out

A box plot does not show every observation, all gaps or the detailed number of peaks. Distinct distributions can share the same quartiles and whisker endpoints. For small samples, a dot plot beside the box can be particularly informative.

A box plot with a longer upper whisker can suggest an upper tail, but the display does not by itself establish a formal distributional model. It can also conceal a mixture of groups whose combined summary is not typical of either group.

Overlapping boxes do not prove that two population medians are equal. Non-overlapping boxes do not by themselves establish a specified statistical significance level. Ordinary boxes are not confidence intervals. Some specialised notched plots have additional inferential conventions, which should not be assumed for the unnotched plots here.

Handle ties and unusual cases

Repeated values can cause the median to coincide with a box edge or make the IQR zero. That is a real feature of the summary, not a rendering failure. When the IQR is zero, the usual fence rule can flag any different value; interpret that result with the raw data and measurement scale.

With very small samples, quartile definitions can have a noticeable effect. State the method and consider showing all points. The plot alone does not establish the sample size or the quality of the study design.

Values exactly on a fence are inside under this set’s convention. Values beyond it are potential outliers, not confirmed errors. Follow the investigation described in Outliers.

Build a reproducible box plot

Record the ordered data, sample size, quartile algorithm, Q1, median, Q3, IQR, fences, observed whisker endpoints and flagged points. Check that the plotted positions match those values on one consistent numerical scale.

Keep the measurement unit and the population or group definition beside the plot. When presenting survey estimates rather than raw unweighted data, do not silently reuse an unweighted quartile calculation if the design requires weights.

Practice questions

  1. With Q1=12Q_1=12, Q3=20Q_3=20 and the listed journey times, where does the upper whisker end?
  2. The second group has Q1=14Q_1=14, median 17 and Q3=22Q_3=22. What is its IQR, and how does its median compare with the first group?
  3. Does overlap between two ordinary boxes prove that their population medians are equal?
Check your answers
  1. At 22, not 32 or 48. The upper fence is 32, and 22 is the largest observed value within it. The 48-minute observation is plotted separately.
  2. Its IQR is 22−14=822-14=8 minutes. Its median is 17−15=217-15=2 minutes higher in these descriptive datasets.
  3. No. Ordinary boxes display sample quartiles. A conclusion about population medians requires an appropriate inferential method and assumptions.

Related topics

Use Histograms to inspect shape that a box plot can hide. Outliers explains unusual observations, and Confidence Intervals distinguishes a descriptive interval from an estimate’s uncertainty.

Sources and further reading