Worked error-bar example

SD vs SEM error bars: spread is not precision.

Standard deviation describes variability among observed experimental units. Standard error describes uncertainty in an estimated mean. They answer different questions, even when drawn with the same whisker shape.

25 raw values2 sample sizes3 interval choices8-minute read

The short answer

Choose the bar from the quantity you need to communicate.

  • Use SD to describe the spread of observed values.
  • Use SEM to describe the estimated precision of the sample mean, but label it explicitly.
  • Prefer a 95% confidence interval when readers need an interpretable range of mean values compatible with the model and data.
Always show the raw points when practical. An identical mean and error bar can conceal skew, clusters, outliers and the number of independent experimental units.

Same mean, similar spread, different n

These are transparent synthetic values, designed only to isolate the effect of sample size. Both columns have mean 10 and similar observed spread. The larger sample contains distinct values rather than duplicated measurements. No biological claim is attached to either column.

Sample Every observed value
n = 5 8, 9, 10, 11, 12
n = 20 7.4, 7.8, 8.2, 8.5, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.2, 10.4, 10.6, 10.8, 11.0, 11.2, 11.5, 11.8, 12.2, 12.6
Raw values with SD, SEM and 95% confidence intervals Both samples have mean ten and similar raw spread. SD bars remain similar, while SEM and confidence intervals narrow in the sample with twenty values. 78 910 1112 13 Observed value n=5 · SD 1.581 · SEM 0.707 n=20 · SD 1.477 · SEM 0.330 SD SEM 95% CI
The SD bars are similar because the observed distributions have similar spread. SEM and the t-based 95% interval become narrower with more independent units. Every point remains visible.

The three calculations

Plotwright uses the sample SD with denominator n − 1. The SEM is then the sample SD divided by the square root of the number of independent units:

SD = √[Σ(xᵢ − x̄)² / (n − 1)]   ·   SEM = SD / √n

For n = 5, SD = 1.5811 and SEM = 0.7071. For n = 20, SD remains 1.4772, but SEM falls to 0.3303. The second SD is 93% of the first; the second SEM is only 47% of the first.

The two-sided confidence interval for a mean uses a t critical value:

95% CI = x̄ ± t(0.975, n − 1) × SEM

That gives 8.0368 to 11.9632 for n = 5 and 9.3087 to 10.6913 for n = 20. The first interval uses t = 2.776, not 2. Treating “±2 SEM” as an exact 95% interval is especially inaccurate in very small samples.

What one SEM does—and does not—mean

An SEM bar is not a region containing most raw observations. It estimates how much a sample mean would vary across hypothetical repetitions under the sampling model. Because SEM contains √n in its denominator, it can become visually tiny while the underlying observations remain highly variable.

Small SEM bars are not evidence of low biological variability. They can reflect a large count of measurements, including a count inflated by treating non-independent cells, fields or technical repeats as separate n.

The denominator only works when n is honest

The experimental unit is the independently assigned or independently sampled unit that supports the intended inference. Ten images from one animal do not automatically make n = 10 animals. Hundreds of cells pooled from three experiments do not make hundreds of independent experimental repeats.

The SuperPlots paper demonstrates why pooling cell-level measurements can create artificially small SEMs and P values. Retain replicate identity, summarize or model the hierarchy appropriately, and calculate inferential uncertainty at the level justified by the design.

The worked technical-versus-biological-replicates example keeps 24 assay readings visible while showing how a nested t test assigns uncertainty to six independent cultures.

Do not read significance from bar overlap

The visual rule depends on what the bars represent, whether groups are independent, and which comparison is being tested. Overlap of SD bars, SEM bars or separate group confidence intervals is not a universal significance test. Paired data are a particularly clear failure: the uncertainty of within-pair differences cannot be recovered from two marginal bars.

Run the analysis that matches the design and inspect its interval for the effect of interest—such as a mean difference—not the decorative overlap between two group summaries.

A compact reporting template

“Points show independent experimental units. Horizontal lines show means; error bars show [SD / SEM / two-sided 95% confidence intervals]. The n = 5 sample had mean 10.0, SD 1.58 and SEM 0.71; the n = 20 sample had mean 10.0, SD 1.48 and SEM 0.33. Confidence intervals were calculated with the t distribution.”

Replace “independent experimental units” with the actual unit—animals, participants, independent cultures or experimental runs—and describe technical replicates separately.

What Plotwright checks

The public sample contains all 25 displayed values, a descriptive Results sheet and three editable point graphs: mean ± SD, mean ± SEM and mean with a 95% confidence interval. The API gate independently checks the closed-form identities and anchors SEM to SciPy's implementation.

Reproduce it yourself: open the sample, inspect the raw table, switch between all three Graph sheets and read the descriptive Results sheet. Nothing is hidden in a screenshot.

Sources and implementation references

Make the uncertainty inspectable

Show the points. Name the bars. Preserve the experimental unit.

Plotwright keeps the data table, descriptive results and editable graph choices in one project.