Visualizing economic data with pretty worldmaps

Fabian Scheler
March 20, 2022

Choropleths are a nice tool for the visualization of geographic data and with R and Python, their creation can be pretty effortless, especially when clean data is readily available. Fortunately, a lot of economic datasets can be loaded from the World Bank Open Data platform. Nevertheless, making the visualization look nice can be a bit cumbersome. For this reason, I have created a small, integrated function that is handling the data download, adjustment, and visualization all in one. The output can easily be exported as high-quality vector-graphic using ggsave.

Have a look at the example below.

GDP per capita is a highly skewed statistic. However, using a log-scaled color scheme yields a very pretty result.

To replicate the example, simply follow these three steps.

1) Install all required packages

2) Load the function

3) Run the function and save the plot

This post is also available on datascience+.