HAHS.
Back to Catalog

Error Bars

chart

Also known as: confidence interval bars, uncertainty bars, whiskers

Show deviationCompare CategoricalNumerical Line/Area

Description

Error bars are interval marks added to a chart to communicate the uncertainty, variability, or precision of data points. They typically appear as thin lines extending above and below (or left and right of) a point estimate, often capped with short perpendicular serifs. Error bars can represent standard deviation, standard error, confidence intervals, or min-max ranges depending on context.

In scientific and statistical communication, error bars are indispensable. They transform a chart of point estimates into a chart of intervals, enabling readers to assess whether differences between groups are likely meaningful or could be due to chance. A bar chart showing two means that appear different may tell a very different story once error bars reveal that the confidence intervals overlap substantially.

Despite their importance, error bars are frequently misinterpreted. Studies have shown that many readers — including scientists — confuse standard error bars with confidence intervals, or incorrectly judge statistical significance by whether bars overlap. Clear labeling of what the error bars represent (95% CI, +/- 1 SD, etc.) is therefore critical. Some visualization researchers advocate replacing error bars with gradient plots or violin plots that show the full distribution of uncertainty, but error bars remain the dominant convention in most scientific fields.

Error Bars — point estimates with uncertainty intervals

When to Use

  • Showing uncertainty or variability around point estimates in scientific or statistical charts
  • Comparing group means where overlap of intervals indicates non-significance
  • Adding precision context to bar charts, line graphs, or dot plots
  • Communicating confidence intervals from regression models or survey estimates

When NOT to Use

  • When the underlying distribution is highly skewed — error bars assume rough symmetry; use a box plot or violin plot
  • When showing raw data is feasible and more informative — plot individual points with jitter instead
  • When the audience is unlikely to understand what the bars represent — simplify or annotate heavily
  • For showing change over time as the primary story — use a line graph with a shaded confidence band instead

Anatomy

  • Point estimate: A dot, bar top, or line point representing the central value (mean, median, or predicted value).
  • Error bar lines: Thin lines extending symmetrically (or asymmetrically) above and below the point estimate.
  • Caps (serifs): Short horizontal ticks at the endpoints of the error bar, making the interval boundaries easier to read.
  • Interval label: A note or legend explaining what the error bars represent (e.g., “95% CI”, ”+/- 1 SD”).
  • Baseline: Optional reference line (e.g., zero or a null hypothesis value) to contextualize the intervals.

Variations

  • Asymmetric error bars: Upper and lower bounds differ (e.g., for log-transformed data or skewed confidence intervals).
  • Shaded confidence band: For line charts, the interval is rendered as a semi-transparent area around the line rather than discrete bars.
  • Gradient error bars: The bar fades in opacity from the center outward, conveying that values near the estimate are more likely.
  • Box-and-whisker extension: Error bars combined with a box showing the interquartile range, as in a box plot.
  • Forest plot: A series of error bars stacked vertically for meta-analysis, showing each study’s effect size and confidence interval.

Code Reference

// Observable Plot - dot plot with error bars
Plot.plot({
  marks: [
    Plot.ruleY(data, {
      x: "category",
      y1: "lower",
      y2: "upper",
      stroke: "#555",
      strokeWidth: 1.5
    }),
    Plot.dot(data, {
      x: "category",
      y: "mean",
      fill: "steelblue",
      r: 5,
      tip: true
    }),
    Plot.ruleY([0])
  ],
  x: { label: "Group" },
  y: { label: "Effect Size" }
})