DenseLines
A technique for visualising hundreds of overlapping time series by converting them into a density heatmap — darker regions show where most lines agree, revealing consensus and outlier bands simultaneously.
// 01 — The chart
What it looks like
A DenseLines plot of 500 climate simulations. The darkest band shows where most simulations agree; lighter fringes show the range of outlier trajectories.
// 02 — Definition
What is DenseLines?
DenseLines is a visualization technique for large collections of time series. Instead of drawing each line individually (which creates illegible spaghetti), it bins line segments into a 2D grid and colours each cell by how many lines pass through it.
The result is a density heatmap where dark regions indicate consensus (many lines agree) and light fringes indicate divergence or outlier behaviour. It combines the strengths of line charts (showing trajectory shape) and heatmaps (handling overplotting).
The technique was introduced by Moritz & Fisher (2018) specifically for ensemble forecasts and simulation outputs where individual lines are too numerous to draw separately.
Key idea: DenseLines treats hundreds of overlapping lines as a probability field — shifting the question from “what does each line do?” to “where do most lines go?”
// 03 — Anatomy
Parts of a DenseLines plot
// 04 — Usage
When to use it — and when not to
- You have 50–10,000+ overlapping time series that would become spaghetti
- Showing ensemble forecasts, Monte Carlo simulations, or bootstrap draws
- You want to show consensus and spread simultaneously
- Comparing the overall shape of simulation bundles across scenarios
- Individual lines are less important than aggregate behaviour
- You have fewer than ~20 time series — individual lines are readable
- Individual line identity matters (e.g. which country performed best)
- You need precise value reading — the density encoding is approximate
- Your audience is unfamiliar with heatmap-style density encoding
- Data is categorical, not continuous
// 05 — Reading guide
How to read a DenseLines plot
Find the darkest band
This is where most lines converge — the modal or median trajectory of the ensemble.
Check the width of the density field
A narrow band means strong consensus; a wide band means high uncertainty or divergence.
Look for bifurcations
If the dark band splits into two, the ensemble has bimodal behaviour — two competing outcomes.
Watch the fringes
Light outlier edges show the range of extreme scenarios. These may be the most important for risk assessment.
Compare across time
Does the band widen over time? If so, uncertainty is growing — similar to a fan chart.
// 06 — Data format
What data you need
Multiple time series sharing the same time axis. Each series is an array of (time, value) pairs. Typically generated from simulations, ensemble models, or bootstrap resamples.
// 07 — Construction
How to build one
Step 1: Define a 2D grid over the time × value space (bins for both axes).
Step 2: For each line segment across all time series, increment the count in every grid cell the segment passes through.
Step 3: Map cell counts to a sequential colour scale (e.g. white → dark blue or white → dark red).
Step 4: Render the grid as a heatmap. Add axis labels and a colour legend showing the count-to-colour mapping.
// 08 — Common mistakes
Mistakes to avoid
Bins too coarse
Large bins blur the density field and hide the line shape. Use enough bins to capture curvature.
Bins too fine
Very small bins create noise — individual line segments become visible again, defeating the purpose.
Linear colour scale on skewed data
If a few cells have very high counts, a linear scale makes everything else look empty. Use a log or quantile scale.
Missing density legend
Without a colour legend mapping opacity to count, the reader can't assess how many lines contribute to each region.
// 09 — Real-world examples
Where you’ll see them
Climate ensemble models
Hundreds of CMIP model runs are shown as DenseLines plots to communicate consensus and spread in temperature projections.
Financial Monte Carlo simulations
Portfolio risk models with thousands of simulated price paths use density visualisation to show likely vs extreme outcomes.
Epidemiological forecasting
Ensemble COVID-19 case forecasts from multiple models are visualised as DenseLines to show agreement and divergence.
// 10 — Quick reference
Key facts
// 11 — Accessibility
Making it accessible
DenseLines plots rely on colour opacity gradients. Use a colourblind-safe palette and provide a textual summary describing the consensus trend, spread, and any bifurcations. Add tooltips showing the density count and approximate value range at each time step.
// 12 — Variations
Common variations
Spaghetti plot (raw)
Draw every line individually with low opacity. Simple but breaks down beyond ~50 lines.
Contour DenseLines
Replace the pixel grid with smooth contour lines at specific density thresholds.
DenseLines + median overlay
The density field plus a bold median line gives both consensus location and spread context.
Animated DenseLines
Lines enter sequentially, building up the density field — useful for presentations.
// 13 — FAQs
Frequently asked questions
What is a denselines?+
DenseLines is a visualization technique for large collections of time series. Instead of drawing each line individually (which creates illegible spaghetti), it bins line segments into a 2D grid and colours each cell by how many lines pass through it.
When should you use a denselines?+
Use DenseLines when you have 50–10,000+ overlapping time series that would become spaghetti. It also works well when showing ensemble forecasts, Monte Carlo simulations, or bootstrap draws, and when you want to show consensus and spread simultaneously.
When should you avoid a denselines?+
Avoid DenseLines when you have fewer than ~20 time series — individual lines are readable. It is also a poor fit when individual line identity matters (e.g. which country performed best), or when you need precise value reading — the density encoding is approximate.
What data do you need to make a denselines?+
Multiple time series sharing the same time axis. Each series is an array of (time, value) pairs. Typically generated from simulations, ensemble models, or bootstrap resamples.
How is a denselines different from a fan chart?+
Both DenseLines and a fan chart can look similar at first glance, but they answer different questions. Reach for DenseLines when the comparisons and patterns it was designed to reveal match what you need to communicate, and choose a fan chart when its particular strengths better fit your data and audience.
What is another name for a denselines?+
DenseLines is also known as Line density plot, ensemble density chart. The name varies between fields, but the visualisation technique is the same.
What size of dataset works best for a denselines?+
DenseLines works best for 50–10,000+ overlapping time series. Outside that range the chart either looks empty or becomes too cluttered to read clearly.
Are denseliness accessible to screen readers?+
DenseLines plots rely on colour opacity gradients. Use a colourblind-safe palette and provide a textual summary describing the consensus trend, spread, and any bifurcations. Add tooltips showing the density count and approximate value range at each time step.