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.
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 |
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:
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:
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.
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.
Sources and implementation references
- Cumming G, Fidler F, Vaux DL. Error bars in experimental biology. Journal of Cell Biology. 2007;177:7–11.
- Krzywinski M, Altman N. Error bars. Nature Methods. 2013;10:921–922.
- Lord SJ et al. SuperPlots: communicating reproducibility and variability in cell biology. Journal of Cell Biology. 2020;219:e202001064.
-
SciPy
stats.semreference, independently exercised by Plotwright's executable guide test.