Home icon
Data Visualisation Guide

Line charts: perception of differences between lines

3 minutes read

Pitfalls in dataviz: chart types

You might be worse at estimating and comparing the difference between lines and curves than you think.

Check the curves on the line chart below. Where do you think difference between both curves is the biggest?

A line chart with 2 lines, who seem to be closer together where the values for both lines strongly rise

Source: Maarten Lambrechts, CC BY SA, 4.0

It may surprise you that both curves are identical, the only difference being that the orange curve is shifted up by a constant. The curves represent

y=x3y = x^3

and

y=x3+1000y = x^3 + 1000

Below, the vertical distance between both curves are highlighted:

The same line chart as above, but with arrows showing the vertical distance between both lines on three locations on the chart

Source: Maarten Lambrechts, CC BY SA, 4.0

Even when you know that that the shapes of the 2 curves are identical, it is still difficult to see that the vertical distance between the two lines is the same across the whole of the chart. This illusion makes it difficult to visually estimate differences between lines, especially lines with steep slopes.

Here is an example of this optical illusion at work with real life data.

A line chart showing 2 lines. An annotation points to a line highlighting the shortest difference between the 2 lines

Source: Analyzing Time Series Data, observablehq.com

The same chart as above, but with the vertical distance between both lines highlighted, which is much bigger than what we perceive

Source: Analyzing Time Series Data, observablehq.com

A solution for this illusion is to plot the difference instead of the absolute values.

A different version of the charts above, with the lines removed and the differences between them highlighted

Source: Analyzing Time Series Data, observablehq.com

The differences can be aligned, to create an even clearer view.

On this chart, the differences between the lines are shifte to have a common baseline

Source: Analyzing Time Series Data, observablehq.com

Related pages

Line charts: line interpolations

Line charts: double y axes

Line interpolations

Scales in line charts

Save the pies for dessert

Correlations

Pitfalls in dataviz: chart types