AI Glossary / Data science and analytics / Advanced

Box plot

Definition

A box plot summarizes the distribution of numerical data using a median, quartiles and whiskers. The box spans the first to third quartile, highlighting the central part of the distribution. Whiskers and separately plotted points depend on the chosen convention. A box plot is useful for comparing distributions, but it does not display every feature of their shape.

What it means

Two groups can have similar averages yet differ substantially in variability or extreme observations. A box plot helps make those differences visible. The median marks the middle of the ordered values, while the box shows the interval between the 25th and 75th percentiles.
Read the chart's definition before interpreting its whiskers. Some versions extend them to the minimum and maximum. A common alternative extends them only to observations within limits based on the interquartile range and plots more distant observations separately. Those points deserve attention, but their position does not establish that they are errors or should be removed.

How it works

Order the observations and calculate the median, first quartile Q1 and third quartile Q3. Draw the box between Q1 and Q3, with a line at the median. The interquartile range is IQR = Q3 − Q1.
Under a common convention, the lower and upper fences are Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Whiskers reach the most extreme observed values within those fences; observations outside are shown individually. The fences are calculated limits, not necessarily observed values or the whisker endpoints.
Specify the quartile and whisker conventions, especially for small datasets. Software can calculate sample quartiles differently. When comparing groups, use consistent units and scales and show sample sizes so a small sample is not mistaken for strong evidence.

Three practical examples

  • A support team compares response-time distributions across channels. The chart shows whether a similar median conceals a longer tail of slow responses, prompting investigation of those cases.
  • A publisher compares article lengths across categories. Editors inspect unusually long entries for scope differences rather than automatically cutting them to match the rest.
  • An AI evaluation team compares task completion times for two workflows. It keeps task difficulty and failed attempts visible, since a box plot of successful attempts alone could conceal an important performance difference.

Think of it this way

A box plot resembles a compact description of where the middle and outer parts of a queue stand along a measuring line. It helps compare several queues without showing every person. But two queues can share the same landmarks while arranging the people between them differently. The summary does not preserve the entire distribution.

Worked example

Take eight invented response times in minutes: 2, 3, 4, 5, 6, 7, 8 and 20. Using the median-of-halves convention, the median is (5 + 6) / 2 = 5.5. Q1 is the median of 2, 3, 4, 5, which is 3.5. Q3 is the median of 6, 7, 8, 20, which is 7.5.
The IQR is 7.5 − 3.5 = 4. The fences are 3.5 − 6 = −2.5 and 7.5 + 6 = 13.5. The whiskers extend to 2 and 8, the most extreme observations inside the fences. The value 20 is plotted separately.
The negative fence does not indicate an observed negative time. Nor does the flagged value prove an error: a complex request might legitimately take 20 minutes. Another quartile convention may change the exact box boundaries, so the calculation rule belongs with the example.

Illustrative case study

In a fictional project, Hazel Support reports a stable median response time and concludes that its service is consistent. An analyst adds monthly box plots and finds that the central spread remains similar while several long response times appear in the latest month.
The team checks those records and discovers a mixture of complex requests and one incorrect timestamp. It corrects the timestamp using the source record and retains the legitimate long cases. It then separates comparable request types and reports sample sizes beside the charts.
Hazel uses the plots to guide investigation and planning. It does not delete every point beyond a fence or treat a visual difference as proof that a staffing change caused the result. This fictional case illustrates exploratory analysis.

Common misconceptions and mistakes

The line in the box normally marks the median, not the mean. The box is not a confidence interval, and its width does not necessarily represent sample size. Some chart variants encode extra information, so the legend matters.
Whiskers are not always the minimum and maximum, and the 1.5 × IQR rule is a convention rather than a universal definition of abnormality. Skewed distributions can legitimately produce many flagged points.
A box plot can hide multiple peaks, gaps or repeated values. For small samples, plotting individual observations can reveal information that the summary conceals. Visual overlap between boxes also does not settle a formal question about differences between populations.

Business use

Use box plots when comparing the center and spread of numerical measurements across groups or periods. Define the measurement consistently and decide how incomplete, failed or missing cases will be represented before drawing the chart.
Pair the summary with sample sizes and an explanation of its conventions. Examine unusual observations in context and document corrections. If the decision concerns a deadline or target, show that threshold separately rather than assuming it coincides with a quartile or fence. Use a histogram or individual-point display when distribution shape is central to the question.

People also ask

Does every point outside the whiskers need removal?

No. Investigate whether it is valid and relevant before making a documented decision.

Does the box contain exactly half the sample points?

It represents the interval between quartiles; ties and sample-quantile conventions complicate an exact point-count interpretation.

Can a box plot establish causation?

No. It describes data and can motivate further analysis, but causal claims need an appropriate design and evidence.

Check your understanding

Why is the upper whisker 8 rather than 13.5 in the example?

Answer: Eight is the largest observed value within the upper fence.

What does the median of 5.5 describe?

Answer: The middle location of the ordered observations under the stated calculation.

Why inspect the value 20?

Answer: It is unusual relative to the central spread, but may be a legitimate observation.

Related terms

  • Median
  • Quartile
  • Percentile
  • Whiskers
  • Outlier
  • Distribution
  • Exploratory data analysis
  • Histogram
  • Violin plot
  • interquartile range
  • whisker

Learn next

Calculate a box plot from a small ordered dataset and label the fences separately from the whiskers. Compare it with a display of every point to see what the summary leaves out.

More in Data science and analytics

  • Bernoulli trial - A Bernoulli trial is a random experiment whose recorded outcome has two possibilities, conventionally called success and failure.
  • Binary variable - A binary variable has two possible substantive values, often represented as 0 and 1 or as two category labels.
  • Boolean - Boolean refers to a logical value or expression with the two truth values true and false.
  • Categorical variable - A categorical variable records which category an observation belongs to, rather than a measured quantity.
  • Causal analysis - Causal analysis investigates whether and how changing one factor would change an outcome.
  • Cherry-Picking - Cherry-picking is the selective use or presentation of evidence that favors a desired conclusion while leaving out relevant evidence that would weaken...

Sources

NIST/SEMATECH e-Handbook, Box Plot: quartiles, alternative whisker conventions and exploratory comparisons. https://www.itl.nist.gov/div898/handbook/eda/section3/boxplot.htm Matplotlib, boxplot documentation: configurable whisker behaviour and plotting conventions. https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.boxplot.html The response times and Hazel Support case are original illustrations. The worked example explicitly uses the median-of-halves quartile convention.

Previous: Box-Pierce test Next: Box's M test

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer