Skip to content

Replace dynamite plots with intervals and raw data

baduncertaintymechanicalWilke 2019 p. 193Cleveland 1994 p. 214Miller 2013 p. 131

How wide is the spread of individual countries behind each continent mean?

Plotly Express Gapminder dataset, country life expectancy across four continents in 2007.

“Bar plots with error bars hide the underlying data distribution and give unequal visual weight to values above and below the mean”

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

Also covered in Cleveland 1994 (3.14 Statistical Variation, p. 214), Miller 2013 (6 Creating Effective Charts, p. 131).

CVD preview

Before

Solid bars with error whiskers conceal the wide spread of African and Asian countries and anchor attention at zero years.

Download before Python code

After

Jittered country points sit behind each mean and 95% confidence interval so skewness, outliers, and group sizes stay visible.

Download after Python code

Values

Continent means range from 54.8 years in Africa to 77.6 years in Europe.

Africa spans 39.6 to 76.4 years around a 54.8 year mean, while Europe clusters tightly between 71.8 and 81.8 years.

Values used in both charts
ContinentCountriesMean life expectancy (years)95% CI half-width
Africa5254.812.62
Asia3370.732.72
Americas2573.611.74
Europe3077.651.07