How to Make a Modified Box Plot: Fences and Outliers

A modified box plot is built the same way as a standard box plot, with one key difference: instead of stretching the whiskers all the way to the minimum and maximum values, you cap them at 1.5 times the interquartile range (IQR) from the box and plot any data points beyond that limit individually as outliers. This makes unusual values immediately visible rather than hiding them inside the whiskers. Here’s how to build one from scratch.

How a Modified Box Plot Differs From a Standard One

In a standard box plot, the whiskers simply extend from the box to the smallest and largest values in the data set. Every data point falls somewhere between the two whisker endpoints, and nothing stands out as unusual.

A modified box plot restricts each whisker to a maximum length of 1.5 times the IQR. Any data point that falls outside this range gets plotted as an individual dot (or asterisk), flagging it as a potential outlier. The whisker stops at the last data point that still falls within the allowed range, not at the fence itself. This distinction matters: the whisker always ends on an actual value in your data set, not on a calculated boundary.

Step 1: Order Your Data and Find the Median

Sort your data set from smallest to largest. Then find the median, the middle value. If you have an odd number of data points, the median is the single middle number. If you have an even number, average the two middle values. This median becomes Q2.

Step 2: Calculate Q1, Q3, and the IQR

Split your data into a lower half (everything below the median) and an upper half (everything above it). If the overall data set has an odd count, exclude the median itself from both halves. If the count is even, include the lower of the two middle values in the lower half and the upper in the upper half.

Now find the median of each half. The median of the lower half is Q1, and the median of the upper half is Q3. If either half has an even count, average its two middle values.

The IQR is simply Q3 minus Q1. This number represents the spread of the middle 50% of your data and is the foundation for everything that follows.

Step 3: Calculate the Inner Fences

The inner fences define the boundary between “normal” data and potential outliers. To find them, multiply the IQR by 1.5, then:

  • Lower fence: Q1 minus 1.5 × IQR
  • Upper fence: Q3 plus 1.5 × IQR

For example, if Q1 is 80 and Q3 is 90, the IQR is 10. Multiply by 1.5 to get 15. Your lower fence is 80 minus 15, which equals 65, and your upper fence is 90 plus 15, which equals 105. Any data point below 65 or above 105 is an outlier.

These fences are calculation tools only. You do not draw them on the plot.

Step 4: Identify Outliers and Whisker Endpoints

Look through your sorted data for any values that fall below the lower fence or above the upper fence. Set those aside as outliers.

Your lower whisker endpoint is the smallest value in the data set that is still at or above the lower fence. Your upper whisker endpoint is the largest value that is still at or below the upper fence. Again, whiskers always land on real data points, not on the fence values themselves. If no data points fall outside the fences, the whiskers simply reach the minimum and maximum, and your modified box plot looks identical to a standard one.

Step 5: Draw the Plot

Draw a number line (horizontal or vertical) with a scale that covers your full data range, including any outliers. Then build the plot in this order:

  • The box: Draw a rectangle from Q1 to Q3.
  • The median line: Draw a line across the box at Q2.
  • The whiskers: Extend a line from Q1 down to the lower whisker endpoint, and from Q3 up to the upper whisker endpoint.
  • The outliers: Plot each outlier individually as a dot beyond the whisker.

Marking Mild vs. Extreme Outliers

Some courses and textbooks distinguish between two levels of outliers. To do this, you calculate a second set of boundaries called outer fences at 3 times the IQR from each quartile (instead of 1.5 times).

A mild outlier falls between an inner fence and an outer fence. These are typically marked with an open circle. An extreme outlier falls beyond an outer fence and is marked with an asterisk. If your class or assignment doesn’t require this distinction, plotting all outliers as simple dots is the standard convention.

A Worked Example

Suppose your data set is: 2, 14, 18, 19, 21, 23, 24, 25, 27, 28, 55.

There are 11 values, so the median (Q2) is the 6th value: 23. The lower half is 2, 14, 18, 19, 21. Its median (Q1) is 18. The upper half is 24, 25, 27, 28, 55. Its median (Q3) is 27.

The IQR is 27 minus 18, which equals 9. Multiply by 1.5 to get 13.5. The lower fence is 18 minus 13.5, which is 4.5. The upper fence is 27 plus 13.5, which is 40.5.

Now check the data. The value 2 falls below the lower fence of 4.5, so it’s an outlier. The value 55 falls above the upper fence of 40.5, so it’s also an outlier. The lower whisker reaches 14 (the smallest non-outlier), and the upper whisker reaches 28 (the largest non-outlier). Your box spans from 18 to 27 with a line at 23, and you plot the values 2 and 55 as individual dots.

Making Modified Box Plots in Software

Python (Matplotlib)

Matplotlib’s boxplot() function creates a modified box plot by default. Outliers appear as points beyond the whiskers automatically. You can customize the outlier markers using the flierprops parameter, which accepts a dictionary of style options like marker shape, color, and size. Setting the symbol parameter to an empty string hides outliers entirely, which effectively turns it back into a standard box plot.

Excel

Excel’s built-in “Box and Whisker” chart type (available in Excel 2016 and later) supports modified box plots. Outliers appear as small filled circles. For older versions, you’ll need to construct the plot manually using stacked bar charts and error bars, then overlay a scatter series for the outlier points.

By Hand or in Google Sheets

If you’re drawing by hand for a class, use graph paper and a consistent scale. Label Q1, Q2, Q3, and the whisker endpoints clearly. Plot outliers as distinct dots. For Google Sheets, there’s no native box plot type, so you’ll need to calculate all the components in cells and assemble them from a combination of chart types.

Common Mistakes to Avoid

The most frequent error is ending the whisker at the fence value instead of at the last actual data point within the fence. If your lower fence is 4.5 but the smallest non-outlier data point is 14, the whisker stops at 14, not at 4.5.

Another common mistake is including the median in both halves when calculating Q1 and Q3. When you have an odd number of data points, the median gets excluded from both the lower and upper halves before you find quartiles. With an even count, you split the data cleanly in two with no overlap.

Finally, make sure your scale is wide enough to show outliers without squashing the box into an unreadable sliver. If your outliers are far from the rest of the data, consider noting the scale break or simply giving the plot enough horizontal (or vertical) room to breathe.