Adjusting scales for World Bank indicators

Application exercise
Practice adjusting scales and guides to make a more readable and informative plot of World Bank indicators.
Modified

September 8, 2026

Note

This application exercise is completed in class and submitted via a worksheet.

Data: World economic measures

The World Bank publishes a rich and detailed set of socioeconomic indicators spanning several decades and dozens of topics. Here we focus on a few key indicators for the year 2024.

The data is stored in wb-indicators.rds. To import the data, use the read_rds() function.

library(tidyverse)
library(viridis)
library(scales)

options(scipen = 999) # avoid printing in scientific notation
theme_set(theme_minimal()) # different default theme
world_bank <- read_rds("data/wb-indicators.rds")

Customize scales

Let’s consider the relationship between female labor participation and per capita GDP. We’ll use the income_level variable to color the points and provide context on the overall wealth of the countries.1

Let’s generate a color-coded scatterplot with a single smoothing line.

ggplot(
  data = world_bank,
  mapping = aes(x = female_labor_pct, y = gdp_per_cap)
) +
  geom_point(mapping = aes(color = income_level)) +
  geom_smooth(se = FALSE)

This is a good starting point, but to improve the interpretability of the chart we need to clean up the scales and guides.

Your turn: Identify any interpretability issues with the plot above. Propose at least five adjustments to the scales and/or guides that would improve the plot.

Footnotes

  1. Note that the income level is based on the GNI per capita, which is strongly correlated with GDP per capita, but not exactly the same.↩︎