# Gradient interval

> Use a gradient interval to show uncertainty as a band that fades towards its edges, dark where the true value most likely lies.

- Data type: Many values of one measure (`spread`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`spread`)
- Example: **We know 2024's temperature four times more precisely than 1850's, and it was the hottest year** (Global surface temperature against the 1861–1890 average, °C, 1850–2025, with its 95% uncertainty)
- How to read it: The line is the best estimate for each year; the shaded band fades from likely to unlikely, and it narrows as thermometers spread around the world.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: 16:9 (best 16:9)

## Use it when
- an estimate with an uncertainty range that changes over time or across items
- you want readers to see that values near the middle are likelier than the edges
- a single interval would look like a hard boundary

## Avoid it when
- the range has no probability behind it (min and max only)
- several overlapping series (bands blur together)
- readers must read the exact bounds (use error bars)

## Fields (data.json)
- `year` (year): the year
- `anomaly` (number, unit "°C", format decimal): best estimate, °C above the 1861–1890 average
- `lower` (number, unit "°C", format decimal): lower bound of the 95% range, °C
- `upper` (number, unit "°C", format decimal): upper bound of the 95% range, °C

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 anywhere along the years to read the estimate and its range
- Play steps through the record every 25 years
- Motion: The line draws itself from 1850 to 2025, then the uncertainty band breathes out around it.
- Sound: A soft pop on hover, higher for warmer years. 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": "gradient-interval",
  "title": "We know 2024's temperature four times more precisely than 1850's, and it was the hottest year",
  "subtitle": "Global surface temperature against the 1861–1890 average, °C, 1850–2025, with its 95% uncertainty",
  "data": "/charts/gradient-interval.data.json"
}
```

## Source
Average temperature anomaly (HadCRUT5), Our World in Data (Met Office Hadley Centre) (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/temperature-anomaly

Note: The fading is drawn by treating the 95% range as a normal error and nesting bands at 30% to 95% confidence; the data gives only the 95% range.

Inspired by: [Uncertainty visualization (gradient plots)](https://doi.org/10.1002/9781118445112.stat08296), Padilla, Kay and Hullman (linked, not copied).

Live: /charts/gradient-interval · Manifest: /charts/gradient-interval.json · Tags: uncertainty, confidence band, climate, temperature, warming, fading band
