From Five Values to a Boxplot
A boxplot turns five summary values into a compact picture on a numerical scale. The picture is useful only if each value is placed at its correct location and the scale is labeled with the variable’s units. For example, a plot of response times in seconds needs a time axis in seconds; the same numerical positions would not describe response times in milliseconds.
In this tutorial, the five values are provided as a summary. The task is to construct the plot from them, not to calculate quartiles from raw data. The main steps are to choose a scale that includes all five values, mark the values in order, draw the box from the first to the third quartile, add a line at the median, and extend the whiskers to the minimum and maximum.
For a valid five-number summary, the values satisfy \( \text{minimum} \leq Q_1 \leq \text{median} \leq Q_3 \leq \text{maximum} \). Some values can be equal, in which case their marks may overlap. The box’s left and right edges represent \(Q_1\) and \(Q_3\) on a horizontal plot; the line inside it represents the median. The whiskers connect the box edges to the minimum and maximum. A vertical boxplot follows the same construction, with the values arranged along a vertical scale.
Choose the Scale Before Drawing
The scale should cover the minimum and maximum and should be easy to read. Choose evenly spaced tick marks, such as every 1 second or every 50 milliseconds, and label the axis with the variable and its units. The five summary values do not all need to fall exactly on tick marks: a value between two ticks should be placed proportionally between them.
A scale may extend a little beyond the minimum and maximum to leave room for clear labels. It should not cut off either endpoint, and its tick spacing must remain uniform. When a value falls between ticks, estimate its position consistently rather than rounding it to the nearest tick. Rounding a summary value for convenience can change the plot and should be avoided unless the displayed values are explicitly reported as rounded.
Write down all five values in increasing order and identify the units of the measurements.
Choose an interval that contains the minimum and maximum, with equal spacing between tick marks. Label the variable and units.
Place the minimum, \(Q_1\), median, \(Q_3\), and maximum at their corresponding positions on the scale.
Draw a box from \(Q_1\) to \(Q_3\), a median line inside the box, and whiskers from the box edges to the minimum and maximum.
Confirm the ordering, scale, units, and endpoints. Make sure the box edges and median line correspond to the correct summary values.
Worked Example: Response Times in Seconds
Suppose a hypothetical set of response times has the five-number summary \(1.2\), \(2.4\), \(3.1\), \(4.6\), and \(6.8\) seconds. Construct a basic boxplot.
1. Confirm the order and units. The minimum is \(1.2\) seconds, \(Q_1=2.4\) seconds, the median is \(3.1\) seconds, \(Q_3=4.6\) seconds, and the maximum is \(6.8\) seconds. They are in increasing order.
2. Choose the scale. A horizontal axis from 0 to 8 seconds with ticks every 1 second includes all five values. Label it “Response time (seconds).” Values such as 2.4 and 6.8 belong between ticks: 2.4 is 0.4 of the way from 2 to 3, and 6.8 is 0.8 of the way from 6 to 7.
3. Place the five marks and connect them. Mark 1.2 for the minimum and 6.8 for the maximum. Draw the box from 2.4 to 4.6, then place the median line at 3.1 inside the box. Extend the left whisker from 2.4 back to 1.2, and the right whisker from 4.6 to 6.8.
4. Check the spacing. The distance from the minimum to \(Q_1\) is \(2.4-1.2=1.2\) seconds. The distance from \(Q_1\) to the median is \(3.1-2.4=0.7\) seconds, and from the median to \(Q_3\) it is \(4.6-3.1=1.5\) seconds. The distance from \(Q_1\) to \(Q_3\) is \(4.6-2.4=2.2\) seconds. These checks help ensure that the marks are not treated as equally spaced just because they are listed in order.
Why a Common Scale Matters
All five values must share the same scale so that distances in the drawing correspond consistently to differences in response time. If one part of the axis is compressed or expanded, the apparent positions can misrepresent the supplied values. Even with a simple sketch, uniform tick spacing and proportionate placement matter.
This can be justified with a linear position rule. Suppose the displayed axis runs from value \(a\) to value \(b\), where \(a<b\), and from drawing position \(L\) to drawing position \(R\), where \(L<R\). A value \(v\) between \(a\) and \(b\) is placed at
The fraction \((v-a)/(b-a)\) gives the value’s relative location within the numerical range. For two values \(v_1<v_2\), subtracting their positions gives
Because the scale has positive width, a larger value has a position farther to the right on a horizontal plot. Equal changes in value also produce equal changes in drawing position. This is why the five marks must be located on one evenly spaced scale, not arranged as five equally spaced labels.
Worked Example: Response Times in Milliseconds
For a second hypothetical set of response times, the five-number summary is 240, 310, 360, 420, and 510 milliseconds. Construct and label a basic boxplot using an axis from 200 to 550 milliseconds with ticks every 50 milliseconds.
1. Label the scale. Write “Response time (milliseconds)” beneath the horizontal axis. The axis begins at 200 and ends at 550, so it contains the minimum of 240 and maximum of 510.
2. Locate values between ticks. The minimum, 240, is 40 milliseconds above 200, so it is \(40/50=0.8\) of the way from the 200 tick to the 250 tick. \(Q_1=310\) is \(10/50=0.2\) of the way from 300 to 350. The median, 360, is \(10/50=0.2\) of the way from 350 to 400. \(Q_3=420\) is \(20/50=0.4\) of the way from 400 to 450. The maximum, 510, is \(10/50=0.2\) of the way from 500 to 550.
3. Draw the box and whiskers. Draw the box from 310 to 420 milliseconds and place the median line at 360 milliseconds. Extend the left whisker from 310 back to 240, and the right whisker from 420 to 510.
4. Check the order. The plotted locations must appear from left to right as 240, 310, 360, 420, and 510. The median line belongs inside the box because \(310<360<420\). The scale and axis label identify both the measured quantity and its units.
Scale Choices and Clear Labels
The same five-number summary can be drawn with different suitable scales. For instance, a summary of times from 4 to 10 minutes could be displayed on an axis from 3 to 11 minutes, or from 0 to 12 minutes. The choice affects how much of the axis is occupied by the plot, but it does not change the positions of the five values relative to one another when the scale is uniform. State the units and choose tick marks that let a reader locate the values without unnecessary guesswork.
A basic boxplot may use a scale whose lower endpoint is above zero when zero is not needed to display the data. The key requirement for this construction is that the axis cover the full range from the minimum to the maximum, show its scale clearly, and use consistent spacing. Starting an axis above zero is not a license to hide the axis endpoints or imply a different numerical interval than the labels show.
Worked Example: A Scale That Starts Above Zero
A hypothetical set of response times, measured in minutes, has the five-number summary 4.0, 5.5, 6.0, 9.0, and 10.0. Construct a basic boxplot on a scale from 3 to 11 minutes, with ticks every 1 minute.
1. Check the range. The axis from 3 to 11 includes both the minimum, 4.0, and maximum, 10.0. Label the axis “Response time (minutes).”
2. Place the five values. Mark 4.0 at the 4-minute tick. Place \(Q_1=5.5\) halfway between 5 and 6. Place the median, 6.0, at the 6-minute tick. Place \(Q_3=9.0\) at the 9-minute tick and the maximum, 10.0, at the 10-minute tick.
3. Connect the values. Draw the box from 5.5 to 9.0 minutes, put the median line at 6.0, and draw whiskers from 5.5 back to 4.0 and from 9.0 to 10.0. The median is close to the left edge of this box because its numerical value is close to \(Q_1\); it should not be shifted toward the center of the box for visual symmetry.
4. Verify all distances. From 4.0 to 5.5 is \(5.5-4.0=1.5\) minutes. From 5.5 to 6.0 is \(6.0-5.5=0.5\) minutes. From 6.0 to 9.0 is \(9.0-6.0=3.0\) minutes, and from 9.0 to 10.0 is \(10.0-9.0=1.0\) minute. The marks should reflect these unequal distances on the uniform scale.
Common Mistakes
- Spacing the five values evenly. The summary lists five ordered values, but the numerical gaps between them may differ. Place each value according to the scale, not according to its position in the list.
- Putting the median at the center of the box. The median goes at its numerical location. The box edges are \(Q_1\) and \(Q_3\), and the median need not be halfway between them.
- Using a scale that omits an endpoint. The minimum and maximum must both be visible as whisker endpoints. Extend the axis if either would fall outside it.
- Forgetting units or using uneven tick spacing. A reader needs to know what the numbers measure, and equal numerical intervals must correspond to equal distances along the axis.
- Confusing a basic plot with a modified boxplot. In a basic boxplot, the whiskers extend to the supplied minimum and maximum. A modified boxplot uses a different convention for whiskers and may show flagged points separately; that is a distinct construction.
Check Your Understanding
Answer each question by referring to the construction rules in this tutorial.
- A five-number summary of response times in seconds is 0.8, 1.1, 1.7, 2.0, and 3.4. What must a suitable horizontal scale include, and which two values form the box edges?
- On an axis with ticks every 10 milliseconds, where should a value of 35 milliseconds be placed relative to the 30- and 40-millisecond ticks?
- Why should the median line not automatically be drawn halfway between the two edges of the box?
- A student draws whiskers from the box edges to the smallest and largest observed values. What kind of boxplot construction is being used?
- For a summary with \(Q_1=4.2\), median \(=4.8\), and \(Q_3=7.2\) minutes, calculate the distance from \(Q_1\) to the median and from the median to \(Q_3\). What does this imply about the median line’s location within the box?