A whisker is the line extending below or above a boxplot’s interquartile-range box. It reaches the lower or upper boundary for non-outlying observations; points beyond it are outliers. section 14.5.1 section 2.5.3
Read a whisker alongside the other parts of a boxplot:
- The box covers the interquartile range, from the 25th to the 75th percentile. section 14.5.1
- The whiskers extend from the box toward the lower and upper non-outlying values. section 14.5.1
- Dots beyond the whisker limits represent outliers, using limits based on 1.5 times the IQR. section 2.5.3
- The horizontal line inside the box marks the median; the mean may be added separately. section 14.5.1 section 2.5.3
p3 <- ggplot(nba_stats, aes(x = o_pts_cat, y = z_wins, fill = o_pts_cat)) +
geom_boxplot(notch = TRUE, alpha = 0.5) +
labs(title = "Points Allowed vs. Wins",
subtitle = "2008-17",
x = "Standardized Points Allowed Category",
y = "Standardized Regular Season Wins") +
stat_summary(fun = mean, geom = "point",
shape = 20, size = 8, color = "white", fill = "white") +
theme(legend.position = "bottom") +
scale_fill_discrete(name = "Points\nAllowed\nZ-Score",
labels = c("< -1", "-1 to 0", "0 to 1","> 1")) +
theme(plot.title = element_text(face = "bold"))
Use the NBA boxplot code to see whiskers compare standardized regular-season wins across standardized points-allowed categories; notches and mean points add context. section 14.5.1
NBA win shares
Boxplots of NBA first-round selections compare career win shares by birthplace, college attendance, and draft year. Their whiskers show the spread of non-outlying careers, while dots identify unusually high or low outcomes. section 2.5.3

