Skip to content

Plot paired measurements against a y = x diagonal

badassociationsjudgmentWilke 2019 p. 129Wilke 2019 p. 287

Which countries gained the most life expectancy between 1982 and 2007 relative to their starting point?

Plotly Express Gapminder dataset, 12 countries in the Americas comparing 1982 and 2007 life expectancy.

“Paired measurements on identical units belong on a scatter plot with equal axis scales and a diagonal equality line”

Claus O. Wilke, "Fundamentals of Data Visualization", p. 127.

Also covered in Wilke 2019 (12 Visualizing Associations Among Two or More Quantitative Variables, p. 129), Wilke 2019 (23 Balance the Data and the Context, p. 287).

CVD preview

Before

Twenty-four grouped bars force readers to compare 12 adjacent bar pairs far out near 60 to 80 years.

Download before Python code

After

Equal 1982 and 2007 axes with a dashed y = x line encode each country's 25-year gain directly as vertical distance above the diagonal.

Download after Python code

Values

All 12 countries improved between 1982 and 2007, with Bolivia rising from 53.9 to 65.6 years.

Every country lies well above y = x, with Bolivia (+11.7 years) and Peru (+10.0 years) showing the steepest upward shifts.

Values used in both charts
Country1982 life expectancy (years)2007 life expectancy (years)Gain (years)
Canada75.880.74.9
Costa Rica73.578.85.3
Chile70.678.68
United States74.778.23.5
Mexico67.476.28.8
Argentina69.975.35.4
Colombia66.772.96.2
Brazil63.372.49.1
Peru61.471.410
Guatemala58.170.312.2
Bolivia53.965.611.7
Haiti51.560.99.4