Error Bars

Error bars #

last modified February 24, 2026

~5 minute read

Think about if the standard error bar with bar ends is really the best choice for your data.

Error bars are a plotting feature primarily intended to visualize the range of uncertainty or variation surrounding a specific data point. Though colloquially termed “error bars,” they are not exclusively restricted to depicting observational error. They are equally critical for illustrating data distributions and serve as an excellent tool for simplifying overly complex visual trends. Consider, for instance, a plot chronicling the average tuition at 4-year universities for each state in the USA. This approach initially might yield:


Plot showing average tuition forming a unicorn mane.


This visualization is exceedingly congested—a phenomenon data scientists colloquially refer to as a “unicorn mane” or “spaghetti plot”. It is essentially ineffective, serving only to convey vague, generalized vibes. With the exception of a few distinct outlines, it is nearly impossible to track individual state trajectories. There is simply no available method to achieve adequate contrast across such a vast multitude of overlapping series.

While there are alternative strategies for parsing dense trends (such as deploying small multiples), there are instances where displaying every individual data point is counterproductive. One simplification method involves discarding differentiating colors and retaining only the general continuous block of data, abandoning any attempt to trace individual lines.


The same plot without distinct individual lines.


A plot like this sends a clear message: you are not supposed to attempt to follow the individual lines. But people might still try, and this will take away focus from what you are trying to show… the general trend. Additionally, this remain a bit messy. To be sure, there are times you might wish to use a plot like the one above. However, in general, there is a better option: represent the mean value with a single point, and represent the spread in values using error bars. This yields the following:


Plot simplified using a single point with error bars.


This plot succeeds in establishing a focal point directly on the central trend. This representation is highly effective in professional literature. Nevertheless, a few subtle design modifications can increase the aesthetic elegance and clarity of this plot even further.

Consider the width of your bar ends. #

The default behavior in many plotting software packages is to append strictly parallel horizontal “bar ends” (or “caps”) to the vertical error metrics, often spanning a width equivalent to the data point marker itself. While occasionally useful, as the plotted points become grouped intimately together, these overlapping bar ends quickly clutter the plot area. In extreme cases, they can inadvertently generate artificial “flattening” effects across the trend line. To illustrate, imagine if the bar ends in the previously successful plot were increased in width by 50%:


Error bars with wide ends overlapping and cluttering the area.


Now, where the trend reaches it maximum, the error bar ends overlap, and this gives a sense of straight lines near the top. Additionally, this places ink associated with one point to the left and right of ink associated with another point, leading to some visual confusion.

In such cases, it might be better to just remove bar ends completely:


Error bars with no bar ends for a cleaner look.


Which, to my eye, is much more clean.

So, for me, I will use bar ends, when points are widely spaced—maybe 2 times farther apart than the bar end width. If the points get closer than that, I typically remove the bar ends, which yields a cleaner and less confusing plot.

Make sure to note what the error bars represent #

In the refined plot above, we consolidated a massive volume of distinct data points into representative aggregated bars. But what statistical metric do these bars explicitly portray? There are two common standards, alongside several other context-dependent possibilities. The primary candidates are:

  • Standard Deviation (SD)
  • Standard Error of the Mean (SEM)

These two properties share a direct mathematical relationship: $\text{Standard Error} = \frac{\text{Standard Deviation}}{\sqrt{N}}$, where $N$ represents the underlying sample size. While this is not a platform dedicated to the rigid mathematics of statistics, it is vital to acknowledge there are distinct, justifiable reasons an author might prioritize mapping one specific metric over the other.

Other statistical parameters regularly depicted by error bars include the full range of values (min/max), the Interquartile Range (IQR), or designated confidence intervals (e.g., $95\%$ CI). These variations, while perhaps less pervasive in general media, are routinely encountered in academic graphics. Crucially, the existence of multiple acceptable interpretations implies that viewers cannot autonomously deduce what metric is being employed. Consequently, it is a non-negotiable requirement to always state explicitly what the error bars on your specific plot represent. A simple, directly applied annotation is an excellent method for doing so.


Annotation clearly stating what the error bars represent.


One could also add short text like “$\pm 1$ std err” directly next to the bar. In scientific journals, you could add this to the caption, but you always need some indication of what you are plotting.

Other ways to represent error #

The error bar is the most standard means by which to represent error, but there are others. Probably the next most common is to use a filled region on the plot:


Using a filled region to represent confidence intervals.


This is especially seen when representing confidence intervals and prediction intervals associated with fitting equations to data.

If there is error on both the $x$ axis and $y$ axis, then people will sometimes represent this as a box or ellipse around the points—though this is much less common. I am sure that, if you think some, you can invent your own cool ways to represent error. But the ones we have covered above are the most common.

Key takeaways #

Having a spread in values is a fact of working with data. Error bars are a way to represent these values. But even though there are some strong conventions in representing error, you can still think through how you want to do this, and you should always always always tell your viewer what you are representing.

page last modified February 24, 2026