Visualization

A Remake of the Factfulness Bubble Chart with Python and Plotly

Let’s update our knowledge with a data-based worldview

Ceren Iyim
Towards Data Science
4 min readJan 23, 2020

--

Image source: Gapminder

Last year, one of my best friends gave a book to me with a note: “I hope it will be a revision for your understanding of the world and a remedy for your global anxieties”. The book has a loud orange cover with a title: “Factfulness: Ten Reasons We’re Wrong About the World — And Why Things Are Better Than You Think” written by the gentleman behind the bubble chart above, Hans Rosling, with other co-authors.

This book has changed how I see the world and equipped me with the tools to correctly interpret the information I receive about our world. Here, the biggest applause goes to the bubble chart in the cover (as appears on the first page):

It may seem a bit redundant to re-do a chart from a book that has been already written, but …

Rather than hoping that everybody will read this book one day, I decided to take action and spread Factfulness on a different Medium because a wise man once said to me,

The universe applauds the action, not wishful thinking.

Using the Gapminder’s (foundation behind the book) open data available in Open Numbers, I am going to show how to make this bubble chart. Python and interactive visualization library Plotly are the best tools for this remake.

This post focuses on spreading the factfulness word and creating interactive visuals. If you want to see the modest, but necessary steps of data loading, cleaning and formatting I encourage you to check out the code here, and the source data here.

Let’s start with the elements of the bubble chart:

  • Each bubble represents a country
  • Color is a region
  • Bubble size shows the country’s population

We are going to use below data frame, to re-create plots:

Here are the colors representing the world in 4 regions:

Using the color-coding above, let’s remake the bubble chart:

The most up-to-date picture of the world with the

  • Lifespan in years, in the y-axis
  • GDP per Capita (PPP) Inflation Adjusted, shortly income, in the x-axis

You can hover over the chart to see the country names and exact numbers of the wealth and health of a country!

Our world is no longer divided into “developed” vs. “developing” or “rich” vs. “poor” [insert a contrasting-pair according to your out-dated worldview]. Now, countries in the world are categorized according to four income levels as accepted by the World Bank.

Most importantly, the majority of the countries lie in the middle (Level 2 and Level 3) with an average life expectancy of 73!

If you are curious about how our lovely world came a long way in income levels and life expectancy from the 1800s to 2018:

Bonus Points: Hans Rosling explains the animated bubble chart of countries in 200 years:

Congratulations! You updated your knowledge about the world with the fact and data-based view, thank you for taking this journey with me 😊. If you want to keep up with the statistics of our world, go ahead and play around with the Gapminder tools!

For comments or constructive feedback, you can reach out to me on responses, Twitter or Linkedin!

--

--