The box plot is the most information-dense chart in an analyst's toolkit. In a single compact shape it shows where a distribution centers, how spread out it is, whether it is skewed, and which values are outliers — and because each box is narrow, you can line up a dozen of them to compare groups at a glance. When a stakeholder asks "how do delivery times compare across cities," a row of box plots answers in one picture.
Its power comes from summarizing rather than showing every point. That is also its limitation, so knowing exactly what a box plot reveals and hides is the key skill.
The five-number summary
Every box plot is built from five statistics, sometimes called the five-number summary:
- Median — the middle value, drawn as a line inside the box. Half the data lies below it.
- First quartile (Q1) — the 25th percentile, the bottom edge of the box.
- Third quartile (Q3) — the 75th percentile, the top edge of the box.
- Whiskers — lines extending to the smallest and largest values within a typical range, commonly 1.5 times the interquartile range past the quartiles.
- Outliers — individual points beyond the whiskers, flagged as unusually far from the rest.
The box itself spans Q1 to Q3, so it holds the middle 50% of the data. Its height is the interquartile range (IQR), a robust measure of spread that ignores extreme values.
Anatomy of a box plot (vertical):
o <- outlier (beyond whisker)
|
----- <- whisker top (max within range)
| |
| | <- Q3 (top of box)
|-----| <- median line
| | <- Q1 (bottom of box)
----- <- whisker bottom (min within range)
Reading skew and spread
A box plot shows skew through asymmetry. If the median sits closer to the bottom of the box and the upper whisker and outliers stretch high, the data is right-skewed. A tall box means wide spread in the middle 50%; a short box means the bulk of values are tightly packed. Comparing box heights across groups instantly shows which group is most variable.
Comparing groups: the real use case
A single box plot is fine, but the chart shines when you place several side by side to compare distributions across categories.
import matplotlib.pyplot as plt
# Illustrative sample: delivery times (minutes) in three cities
city_a = [22, 25, 26, 28, 30, 31, 33, 35, 40, 55]
city_b = [30, 33, 35, 36, 38, 40, 42, 45, 48, 70]
city_c = [18, 20, 21, 22, 24, 25, 27, 28, 30, 33]
fig, ax = plt.subplots(figsize=(7, 4))
ax.boxplot([city_a, city_b, city_c],
tick_labels=["City A", "City B", "City C"])
ax.set_ylabel("Delivery time (minutes)")
ax.set_title("City C is fastest and most consistent",
loc="left", fontweight="bold")
for spine in ["top", "right"]:
ax.spines[spine].set_visible(False)
plt.tight_layout()
plt.show()
What this renders: three box plots side by side. City C's box sits
lowest and is short (fast and consistent deliveries), City A is in the
middle with one high outlier at 55, and City B's box sits highest with
a long reach and an outlier at 70 (slowest and most variable). The
comparison across cities is immediate: lower and shorter is better.
Note: in recent matplotlib the label argument is tick_labels; older versions used labels, which now raises a deprecation warning.
When a box plot misleads: hidden shape
The box plot's compression is a double-edged sword. Because it shows only quartiles, it cannot reveal the shape between them. A bimodal distribution — two distinct clusters — can produce a box plot identical to a smooth single-peak one with the same quartiles. If the underlying shape matters, pair the box plot with a histogram, or use a violin plot, which draws the full density on each side of the box.
Practical usage
Analysts use box plots to compare a metric across segments — revenue per plan tier, response time per server, scores per cohort — where the side-by-side layout makes differences in center and spread obvious. They are also a fast outlier-detection tool: the plotted outlier points immediately flag values worth investigating before they distort averages. In dashboards, box plots are less common than bars and lines because non-technical audiences find them harder to read, so analysts often reserve them for exploratory work and technical reviews.
Common mistakes
- Assuming shape. A box plot hides multi-modality. Do not conclude the data is single-peaked from a box plot alone; check a histogram.
- Using it for non-technical audiences unexplained. Many stakeholders do not know how to read quartiles and whiskers. Explain the parts or choose a simpler chart.
- Ignoring sample size. A box plot of five points is barely meaningful; the quartiles are unstable. Note the group sizes.
- Confusing whisker conventions. Whiskers can be drawn to 1.5×IQR, to min/max, or to percentiles depending on the tool. State which convention is in use.
- Comparing groups with wildly different counts without noting it, which can make spread differences misleading.
In interviews
A frequent question is "explain a box plot" or "how would you compare a metric across five segments." A strong answer names the five-number summary, explains that the box is the IQR and the line is the median, describes how outliers are flagged, and emphasizes the side-by-side comparison use case. Adding the caveat that box plots hide bimodality — and that you would confirm with a histogram — signals the kind of careful thinking interviewers want.
Where this fits in your learning path
The box plot is the compact partner to the histogram in the distribution branch of the choosing the right chart framework: histograms for detailed shape, box plots for group comparison. Together with the scatter plot they form the core exploratory toolkit on the data analyst roadmap and across the data analytics hub.
Frequently Asked Questions
What does a box plot show?
What is the box in a box plot?
How are outliers shown on a box plot?
When should I use a box plot instead of a histogram?
Can a box plot hide bimodal data?
Want to Build Your Career in Data Analytics with AI?
Join CodeBegun and train with working industry engineers — See the Data Analytics course in Hyderabad

