Worked graphing example

Two bars threw away the pairing.

Eight subjects measured twice. Every single one decreased. Draw it as two bars of group means and that fact is invisible — along with most of the evidence.

8 subjectsMeasured twice8 of 8 decreased6-minute read

The problem

The figure and the analysis are the same decision.

In a paired design each subject is its own control. A figure that shows two group means has quietly discarded the link between the two measurements — and a reader cannot recover it. The choice of graph is not cosmetic here: it mirrors exactly the choice between a paired and an unpaired analysis of the same sixteen numbers.

The measurements

Subject 1 2 3 4 5 6 7 8
Before 120 135 128 140 132 125 138 130
After 115 128 122 133 130 119 131 124
Change −5 −7 −6 −7 −2 −6 −7 −6

Eight of eight subjects decreased. The changes cluster tightly between −7 and −5, with subject 5 the only mild responder at −2.

What two bars would show

Group summary Mean SD
Before 131.000 6.698
After 125.250 6.319

Two bars 5.75 apart with SDs above 6 each. They overlap heavily, and the figure suggests a small effect swamped by subject-to-subject variation. That reading is wrong — but it is the only reading the figure permits, because the between-subject spread that dominates it is precisely the nuisance the paired design was built to remove.

The same sixteen numbers, two analyses

Analysis t P (two-sided)
Paired t test (df = 7) −9.744 0.0000254
Unpaired t test, pairing ignored −1.766 0.0991

The paired analysis estimates the mean within-subject change: −5.750, SD of the differences 1.669, 95% confidence interval −7.145 to −4.355 using t(7) = 2.3646. The unpaired analysis asks a different question — whether two independent groups differ — and against a between-subject SD near 6.5 the same 5.75 shift is unremarkable.

Practical rule: if the design is paired, draw the pairing. Connect each subject's two measurements with a line, or plot the per-subject changes directly against zero. Both figures show what the paired analysis uses; two bars show what it discards.

Building the figure

  1. Enter Before and After as two columns of the same table with one row per subject, so row position carries the pairing.
  2. Plot subject lines from Before to After — eight lines, all descending here, which is the finding.
  3. Or plot the eight differences as a single column with a mean and its confidence interval, and mark zero explicitly.
  4. Label the axis with the measured quantity and its units, not with “change” alone; a reader needs to know the direction of benefit.
  5. Run the paired analysis on the same table, so the figure and the P value cannot drift apart.
Limit: pairing is a property of the design, not a switch that improves results. It is justified only when the two measurements genuinely come from the same experimental unit. A before-and-after series with no control arm also cannot separate the intervention from time, regression to the mean, or repeated-measurement effects — the paired test quantifies the change, it does not attribute it. See paired vs unpaired t tests for when the pairing is legitimate, and paired t vs Wilcoxon signed-rank for what to do when the differences are not plausibly normal.

What Plotwright checks

Both t tests above come from the engine's t-test routes, which carry published-reference checks on the validation page. Every value on this page is reproducible from the sixteen visible measurements in the linked editable project.

Sources and reproducibility

  1. Weissgerber, T. L., Milic, N. M., Winham, S. J. & Garovic, V. D. (2015), “Beyond Bar and Line Graphs: Time for a New Data Presentation Paradigm”, PLOS Biology—why summary bars mislead for small samples and paired designs, with recommended alternatives.
  2. Paired vs unpaired t test—the same estimand question worked through a different dataset.
  3. Grouped bar graphs and error bars—what SD, SEM and confidence-interval bars each claim.
  4. Plotwright statistical validation—published expected values, numerical tolerances and evidence limits.

Let the figure show what the test used.

Plotwright keeps the paired table, the analysis and the editable figure together, so a graph cannot quietly contradict the P value beside it.