What is a Box Plot?
A box plot (also called a box-and-whisker plot) is a standardized way of displaying the distribution of data based on a five-number summary: minimum, first quartile (Q1), median, third quartile (Q3), and maximum. Invented by statistician John Tukey, it is one of the most widely used tools in exploratory data analysis.
The "box" spans from Q1 to Q3 — the interquartile range (IQR) — and contains a line marking the median. The "whiskers" extend to the most extreme data points within 1.5 × IQR of the quartiles. Points beyond the whiskers are plotted individually as potential outliers.
Why Use Box Plots?
- Compare groups instantly. Place boxes side by side to see medians, spreads, and outliers across categories.
- Detect skewness visually. A lopsided box reveals asymmetry — long upper whisker = right skew.
- Identify outliers objectively. The IQR-based Tukey fences method flags statistically unusual data points.
- Summarize large datasets compactly. One box plot can represent thousands of data points.
Frequently Asked Questions
What does a box plot show?
How many data points do I need?
Can I compare multiple datasets?
How are outliers detected?
Key Terms
- Minimum (Min)
- The smallest data point excluding outliers.
- First Quartile (Q1)
- The median of the lower half. 25% of data falls below Q1.
- Median (Q2)
- The middle value. 50% of data falls below the median.
- Third Quartile (Q3)
- The median of the upper half. 75% of data falls below Q3.
- Maximum (Max)
- The largest data point excluding outliers.
- Interquartile Range
- Q3 − Q1. Measures statistical spread; the width of the box.
- Mean
- The arithmetic average of all data points.
- Outliers
- Data points below Q1−1.5×IQR or above Q3+1.5×IQR (Tukey fences).
Computation Method
- Quartiles are calculated using linear interpolation (method 7 from Hyndman & Fan, 1996), consistent with Python's NumPy and pandas defaults.
- Outlier detection uses the Tukey fences method: lower fence = Q1 − 1.5 × IQR, upper fence = Q3 + 1.5 × IQR.
- Chart scaling caps the display axis at the upper fence value so the visualization remains clear even when extreme outliers are present.
References
- Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley.
- McGill, R., Tukey, J. W. & Larsen, W. A. (1978). "Variations of Box Plots." The American Statistician, 32(1), 12–16.
- Frigge, M., Hoaglin, D. C. & Iglewicz, B. (1989). "Some Implementations of the Boxplot." The American Statistician, 43(1), 50–54.
- Hyndman, R. J. & Fan, Y. (1996). "Sample Quantiles in Statistical Packages." The American Statistician, 50(4), 361–365.