Master box plots, violin plots, outlier detection, and key statistical concepts — all in one place.
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 John Tukey in the 1970s, the box plot is built on the five-number summary:
| Statistic | Description |
|---|---|
| Minimum (Min) | The smallest data point, excluding outliers |
| First Quartile (Q1) | 25th percentile — 25% of data falls below Q1 |
| Median (Q2) | 50th percentile — the middle value of the sorted data |
| Third Quartile (Q3) | 75th percentile — 75% of data falls below Q3 |
| Maximum (Max) | The largest data point, excluding outliers |
| IQR | Q3 − Q1 — the spread of the middle 50% of data |
| Whiskers | Lines from the box extending to min and max (non-outlier range) |
| Outliers | Points beyond 1.5 × IQR from Q1 or Q3 (Tukey fences) |
| Feature | Box Plot | Violin Plot |
|---|---|---|
| Display | Summary statistics | Full distribution shape |
| Density | Not shown | KDE curve on each side |
| Multi-modality | Cannot show (only hints) | Reveals multiple peaks clearly |
| Outliers | Marked explicitly | Visible in tails |
| Best for | Quick comparisons | Distribution analysis |
| Space | Compact | Wider |
The most common method. Any data point outside [Q1 − 1.5×IQR, Q3 + 1.5×IQR] is flagged as an outlier.
Values with a Z-score greater than 3 (or less than −3) are considered outliers. This assumes the data is approximately normally distributed.