Are Fences Included in the Boxplot? Understanding the Hidden Boundaries of Your Data
If you have ever looked at a boxplot and wondered where those mysterious “whiskers” end, you are already asking the right question. Fences are the invisible rules that decide which data points stay inside the whiskers and which ones get flagged as outliers. Understanding whether fences are actually drawn in a boxplot is essential for reading charts correctly and for explaining your results to others.
In short, fences are calculated for every standard boxplot, but they are usually not drawn as visible lines. They act behind the scenes, guiding where the whiskers stop and which points are marked as outliers. This article unpacks exactly what fences are, how they relate to the boxplot you see on screen, and why the distinction matters for anyone working with data.
What Exactly Are Fences in a Boxplot?
Fences are numerical boundaries derived from the quartiles of a dataset, and they define the limits beyond which a value is considered unusual. The two most common fences are the inner fences, placed 1.5 times the interquartile range (IQR) below Q1 and above Q3. Values outside these inner fences are typically plotted as individual outlier points.
There are also outer fences, located 3 times the IQR beyond the quartiles, which help distinguish mild outliers from extreme ones. Some statistical software uses these outer fences to classify outliers as “far out” versus “outside.” Together, inner and outer fences form a layered safety zone around the middle 50% of your data.
The Formula Behind the Fences
The math is simple once you know the quartiles. The IQR is the distance between the third quartile (Q3) and the first quartile (Q1), and every fence is built from that single number.
- Lower inner fence = Q1 − (1.5 × IQR)
- Upper inner fence = Q3 + (1.5 × IQR)
- Lower outer fence = Q1 − (3 × IQR)
- Upper outer fence = Q3 + (3 × IQR)
Because these values are computed from the data, they change with every dataset. A boxplot for exam scores will have different fences than a boxplot for monthly sales, even if both charts look similar at a glance.
Are Fences Drawn on the Boxplot Itself?
Here is the key answer: in a standard boxplot, fences are not drawn as visible lines or marks. What you see are the box, the median line, the whiskers, and any outlier dots. The fences exist only in the calculation, quietly determining where the whiskers are allowed to extend.
This is why two analysts can look at the same boxplot and disagree about the “edge” of the data. The whisker tip is not the fence; it is the most extreme data point that still falls inside the fence. The fence itself may sit slightly beyond that tip, invisible to the eye.
How Fences Shape the Whiskers
The whiskers are drawn from the box to the smallest and largest observations that remain within the inner fences. Any value past the fence is excluded from the whisker and plotted separately as an outlier. This design keeps the whiskers honest: they represent real data, not arbitrary boundaries.
Different software follows slightly different conventions, which is worth knowing before you compare charts. Some tools extend whiskers to the fence itself when no data point reaches it, while others stop at the last valid observation. Always check the documentation of the tool you use so your interpretation stays accurate.
Why Fences Are Calculated but Rarely Shown
Fences are hidden for a practical reason: drawing them would clutter the chart and confuse readers who expect a clean visual summary. The boxplot was designed by John Tukey as a compact, five-number summary, and adding fence lines would undermine that simplicity.
That said, fences are not secret knowledge. Many advanced plotting libraries let you display them if you want, and statistical reports often mention them in the methodology. The choice to hide them is about readability, not about withholding information.
When You Might Want to Show Fences
There are situations where making fences visible adds real value, especially in teaching and quality control. Seeing the fence alongside the whisker helps audiences grasp why a particular point was flagged.
- Teaching statistics: students understand outliers faster when they can see the boundary that defines them.
- Quality control: engineers may want to display specification limits that mirror fence logic.
- Data audits: analysts reviewing flagged values benefit from seeing exactly where the cutoff sits.
- Stakeholder presentations: showing the fence can preempt questions about why certain points were excluded.
In most everyday reporting, though, the standard boxplot without visible fences remains the better choice. Clarity wins over completeness when your audience needs a quick read of the distribution.
Fences Versus Whiskers: Clearing Up the Confusion
Many people use “fence” and “whisker” interchangeably, but they are not the same thing. A whisker is a drawn line representing actual data, while a fence is a calculated threshold that may or may not coincide with a data point. Confusing the two leads to misreading how extreme a value really is.
Think of it this way: the fence is the rule, and the whisker is the result of applying that rule to your specific numbers. The fence stays fixed by formula, but the whisker length depends on where your data actually falls.
A Quick Example
Suppose a dataset has Q1 = 20, Q3 = 40, so the IQR is 20. The upper inner fence is 40 + 30 = 70, and the lower inner fence is 20 − 30 = −10. If the largest observed value is 65, the upper whisker ends at 65, well inside the fence. If another dataset has a maximum of 85, that point sits beyond the fence and appears as an outlier dot.
Notice that in the first case the fence at 70 is never drawn, yet it still did its job by confirming that 65 is a normal value. This invisible labor is exactly what makes fences so useful and so easy to overlook.
How Different Tools Handle Fences
Not all software treats fences identically, and knowing the differences prevents embarrassing misinterpretations. Most mainstream tools follow Tukey’s 1.5 × IQR convention, but the details of whisker placement and outlier labeling vary.
- R (boxplot): whiskers extend to the most extreme value within 1.5 × IQR; points beyond are plotted individually.
- Python (matplotlib, seaborn): default whiskers follow the same 1.5 × IQR rule, with an adjustable parameter for custom fences.
- Excel: the built-in box and whisker chart offers options for inclusive or exclusive quartiles and can show inner or outer points.
- SPSS and SAS: both compute fences and label outliers, with settings that let analysts choose the multiplier.
Because defaults differ, two charts of the same data can look slightly different across platforms. Always document which convention you used, especially in published research or shared dashboards.
Customizing the Fence Multiplier
The 1.5 multiplier is a convention, not a law of nature, and some fields adjust it to suit their data. In highly skewed distributions, analysts sometimes use a larger multiplier to avoid flagging too many legitimate values as outliers.
Conversely, sensitive applications like fraud detection may lower the multiplier to catch more suspicious points. Whatever you choose, state it clearly so readers know how the fences were set. Transparency about the multiplier is transparency about your entire outlier story.
Common Misconceptions About Fences
Several myths surround fences, and clearing them up improves both chart literacy and statistical communication. The most persistent misconception is that fences are drawn lines that you simply cannot see due to formatting.
Another common error is assuming that any point beyond a fence is a mistake or should be deleted. In reality, outliers often carry the most important information in a dataset, and fences merely flag them for attention rather than condemnation.
Myths Worth Retiring
- “The whisker tip is the fence.” No, the whisker tip is the most extreme value inside the fence.
- “Outliers beyond fences are errors.” Not necessarily; they may be genuine, meaningful observations.
- “Fences are always 1.5 × IQR.” That is the default, but the multiplier can be changed.
- “A boxplot without visible fences is incomplete.” Standard boxplots intentionally omit them for clarity.
Correcting these misconceptions helps teams have more productive conversations about data quality. It also prevents the careless deletion of valid data simply because it fell outside an invisible boundary.
Practical Tips for Reading Boxplots with Fences in Mind
When you examine a boxplot, remember that the visible elements tell only part of the story. The whiskers show you the range of non-outlying data, while the hidden fences explain why the whiskers stop where they do. Keeping both layers in mind leads to sharper, more accurate conclusions.
It also helps to check the sample size and the shape of the distribution before trusting the fences too heavily. Small samples produce unstable quartiles, and skewed data can generate fences that flag many legitimate values as outliers.
A Simple Checklist
- Identify Q1, Q3, and the median from the box.
- Note where the whiskers end and whether any dots appear beyond them.
- Mentally compute the IQR and the inner fences to see the hidden boundary.
- Check the tool’s documentation for its whisker and outlier conventions.
- Investigate flagged points rather than automatically removing them.
Following this routine turns a quick glance into a genuine analysis. It also equips you to explain the chart confidently to colleagues who may not know that fences exist at all.
Conclusion: Fences Are There, Even When You Cannot See Them
So, are fences included in the boxplot? The answer is yes in computation and usually no in appearance. Fences are calculated for every standard boxplot to determine whisker length and outlier status, but they are rarely drawn as visible lines. Understanding this hidden layer transforms how you read distributions and how you communicate findings to others.
Next time you build or review a boxplot, take a moment to compute the fences yourself and see what they reveal about your data. Share this article with a colleague who has ever wondered where those whiskers really come from, and explore our other guides on data visualization at Kreatif Anak Bangsa to keep building your analytical confidence.