An animated donut chart for the share in World Population of different regions using World Bank Data
Animation
World Bank
Author
Aditya Dahiya
Published
May 20, 2024
Share of different regions in the total world population, from 1960 to 2023
Global population distribution, visualized through an animated donut chart. Using midyear estimates from the World BankDataBank and inspired by the compelling visual style of James Eagle’s analysis on internet browser popularity, this chart illustrates the percentage share of the total world population across seven distinct regions: East Asia & Pacific, Middle East & North Africa, Europe & Central Asia, South Asia, Latin America & Caribbean, Sub-Saharan Africa, and North America. This engaging animation provides a dynamic perspective on demographic trends, reflecting data sourced from the United Nations Population Division, national statistical offices, and other reputable agencies. It shows how the world’s population is distributed and how these regions contribute to the global demographic landscape.
How I made this graphic?
Loading required libraries and data import
Code
# Data Import and Wrangling Toolslibrary(tidyverse) # All things tidylibrary(janitor) # Cleaning names etc.library(wbstats) # Fetching World Bank Data# Final plot toolslibrary(scales) # Nice Scales for ggplot2library(fontawesome) # Icons display in ggplot2library(ggtext) # Markdown text support for ggplot2library(showtext) # Display fonts in ggplot2library(gganimate) # For animationrawdf <-wb_data(indicator ="SP.POP.TOTL",country ="regions_only",start_date =1960,end_date =2023,return_wide =FALSE,gapfill =TRUE,mrv =65) |>select(region = country,year = date,population = value ) region_levels <-c("South Asia","Sub-Saharan Africa","Latin America & Caribbean","Middle East & North Africa","East Asia & Pacific","Europe & Central Asia","North America")
Visualization Parameters
Code
# Font for titlesfont_add_google("Dosis",family ="title_font") # Font for the captionfont_add_google("Saira Extra Condensed",family ="caption_font") # Font for plot textfont_add_google("Saira Semi Condensed",family ="body_font") showtext_auto()# Colour Palettemypal <- paletteer::paletteer_d("feathers::bee_eater")mypal <- paletteer::paletteer_d("futurevisions::grand_tour")mypal_fill <- paletteer::paletteer_d("ghibli::PonyoLight")mypal_medium <- paletteer::paletteer_d("ghibli::PonyoMedium")mypal_col <- paletteer::paletteer_d("ghibli::PonyoDark")# Background Colourbg_col <-"white"# Colour for the texttext_col <-"grey20"# Colour for highlighted texttext_hil <-"grey30"
Annotation Text for the Plot
Code
plot_title <-"Global Population Distribution"plot_subtitle <-"(1960 to 2023)"plot_caption <-"Data: World Bank. | Graphics: @adityadahiyaias on X"