# Error bars

> Use error bars to show estimates with their uncertainty, so readers can see which differences are real and which are noise.

- Data type: Many values of one measure (`spread`)
- Free (MIT): install with `npx chartreuse add error-bars`, or registry item `/r/error-bars.json`
- Example: **Two ways of measuring how fast the universe expands still disagree** (Published measurements of the Hubble constant since 2013, km/s per megaparsec, with their reported uncertainty)
- How to read it: Each row is one published measurement: the dot is the value and the bar its uncertainty; the two shaded columns are Planck's and SH0ES's results, which no longer overlap.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: none passed; closest 9:16

## Use it when
- each estimate comes with an interval (a margin of error, a standard deviation, a range)
- the question is whether estimates differ beyond their uncertainty
- up to about 50 estimates

## Avoid it when
- the interval has no stated meaning (say what the bar is)
- readers will treat the bar ends as hard limits (consider a gradient interval)
- the estimates are a time series (use a band)

## Fields (data.json)
- `date` (date): publication date
- `value` (number, unit "km/s/Mpc", format decimal): the measured Hubble constant, km/s/Mpc
- `lo` (number, unit "km/s/Mpc", format decimal): value minus its reported uncertainty
- `hi` (number, unit "km/s/Mpc", format decimal): value plus its reported uncertainty
- `observer` (text): the team or instrument; up to two rows named in hints.references get shaded reference bands
- `group` (category): the kind of method, sets the colour (up to 6 coloured, the rest grey; hints.groups sets the order)

Units are the example's: with your own data, set each number field's `unit` and `format` (percent, count, decimal, currency, compact) in the meta you pass to mount, or `chartreuse render --unit field=text --format field=count`. Scales and labels follow your data.

## Interactions, motion, sound
- hover or tap a row for the team, value and range
- Motion: Each bar stretches out from its dot, oldest measurement first.
- Sound: A soft pop on hover, pitched by method. Quiet while it draws and between steps; mute it from its card. (sound is off until the viewer turns it on)

## Example spec
```json
{
  "chart": "error-bars",
  "title": "Two ways of measuring how fast the universe expands still disagree",
  "subtitle": "Published measurements of the Hubble constant since 2013, km/s per megaparsec, with their reported uncertainty",
  "data": "/charts/error-bars.data.json"
}
```

## Source
Hubble's law: table of measured values of the Hubble constant, Wikipedia (CC BY-SA 4.0), retrieved 2026-12-01: https://en.wikipedia.org/wiki/Hubble%27s_law

Note: Uncertainties are as each paper reports them (mostly one standard deviation). The grouping into early-universe, distance-ladder and other methods is ours, from each row's method.

Live: /charts/error-bars · Manifest: /charts/error-bars.json · Tags: uncertainty, confidence interval, estimates, space, cosmology, Hubble tension, science
