Understand the idea
A boxplot compresses a whole distribution into a compact visual summary: a box spanning the middle 50% of the data (from the first to the third quartile), a line marking the median inside that box, and whiskers extending out to the most extreme values that are not considered unusual (within 1.5 times the box's width from either edge). Any points beyond the whiskers are drawn individually as potential outliers.
Boxplots and histograms both show distributions, but they earn their keep in different situations. A histogram shows the fine-grained SHAPE of one distribution very clearly (is it bell-shaped, skewed, two-peaked?). A boxplot sacrifices that fine detail in exchange for being much easier to line up SIDE BY SIDE across several groups at once, making group comparisons (does group A's typical value and spread differ from group B's?) far more direct.
A few visual cues to watch for: if the median line sits noticeably off-center within the box, or if one whisker is much longer than the other, that is a sign of skewness in the underlying data; the boxplot is quietly telling you the distribution is not symmetric even without a histogram alongside it.
A box plot is also called a box and whisker plot or a box-and-whisker diagram.
Practitioner explanation
KernelStats draws the standard five-number summary per group (or overall, if no grouping column is supplied), computing the quartiles as Tukey's hinges (the rule R's boxplot() and fivenum() use, and the one the Python and R code on the Code tab reproduce), and draws as individual dots ONLY the values beyond the whiskers (boxpoints='outliers'): the values inside the whiskers are summarized by the box, not plotted one by one, and the caption counts the dots. Whiskers extend to the most extreme values within 1.5*IQR of the quartiles, the conventional Tukey fence definition; points beyond that are drawn as individual markers rather than folded into the whisker. Above 5,000 values in a group the card embeds only the exact hinges, fences and outliers instead of every value and the disclosure strip says so; the quartiles, whiskers and outlier counts are computed from all rows regardless.
This is a purely descriptive visualization: no hypothesis test, no p-value, no assumption checks. When a boxplot comparison across groups suggests a real difference worth quantifying formally, the natural next step is a two-sample t-test, one-way ANOVA, or their rank-based equivalents (Mann-Whitney, Kruskal-Wallis) depending on how the accompanying assumption checks (normality, equal variances) come out; the boxplot itself makes no claim about statistical significance.
When to use it
Consider it when
You want a compact visual comparison of a numeric variable's median, spread, and potential outliers, especially across several groups side by side.
Use caution when
You need to see the fine-grained shape of a single distribution (modality, exact skew shape; a histogram shows this more clearly than a boxplot's compressed five-number summary), or you want a formal statistical test of a group difference rather than a visual comparison.
Formulas and symbols
Quartiles and median (the box)
Q1/Q3 the first/third quartiles; the box spans Q1 to Q3, the line inside marks the median. The whiskers stop at the Tukey fences below, so they reach the minimum and maximum only when no point lies beyond a fence.
Whisker (Tukey fence) extent
IQR = Q3 - Q1. Whiskers extend to the most extreme observed values within this range; points beyond are drawn as potential outliers.
Assumptions and checks
- A boxplot's whiskers and flagged outliers follow the conventional 1.5x-IQR rule; this convention describes distance from the middle 50% of the data, not a statistical test for whether a point is a genuine anomaly, so a flagged point is not automatically wrong or removable data.
In KernelStats: Not checked by KernelStats: the 1.5x-IQR convention is applied uniformly; no distributional test backs the outlier flag.
Alternatives
- Histogram. You need to see the detailed shape of a single distribution rather than compare several groups' summaries side by side.
- One-Way ANOVA. A visual difference across boxplot groups is worth quantifying formally with a p-value and effect size.
Worked example
Scenario
Comparing body mass distributions across three penguin species with a grouped boxplot.
Result
Gentoo shows a visibly higher median and box position than Adelie or Chinstrap, whose boxes overlap substantially with each other.
Interpretation
The clear separation of Gentoo's box from the other two species suggests a real difference in body mass worth testing formally (a one-way ANOVA or Kruskal-Wallis test), while the overlap between Adelie and Chinstrap suggests their difference, if any, is more modest and would need a specific pairwise comparison to characterize.
Dataset: penguins.csv
Common misconceptions
Misconception
Every point plotted beyond a boxplot's whiskers is a data error that should be investigated or removed.
Correction
Points beyond the 1.5*IQR whisker fence are flagged as POTENTIAL outliers by a purely mechanical rule, not verified errors. Depending on the underlying distribution's natural shape, a meaningful fraction of genuine, correct observations can fall beyond this fence (this happens routinely for skewed or heavy-tailed data); each flagged point deserves individual judgment, not automatic removal.
References
- NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.3.9 Box plot, NIST/SEMATECH (2012), §1.3.3.9.
- Exploratory Data Analysis, Tukey, J. W. (1977).
