• Steven Ponce
  • About
  • Data Visualizations
  • Projects
  • Resume
  • Email

On this page

  • Steps to Create this Graphic
    • 1. Load Packages & Setup
    • 2. Read in the Data
    • 3. Examine the Data
    • 4. Tidy Data
    • 5. Visualization Parameters
    • 6. Plot
    • 7. Save
    • 8. Session Info
    • 9. GitHub Repository
    • 10. References
    • 11. Custom Functions Documentation

A Century of Stagnation. Four Decades of Change.

  • Show All Code
  • Hide All Code

  • View Source

Share of the world population living in extreme poverty (cost of basic needs approach), 1820–2018. Most of the decline occurs after 1980. Early estimates (pre-1981) carry uncertainty.

30DayChartChallenge
Data Visualization
R Programming
2026
Share of the world population living in extreme poverty (cost-of-basic-needs approach), 1820–2018. Most of the decline occurred after 1980. Early estimates (pre-1981) are subject to uncertainty. Built with ggplot2 in R using data from Moatsos (2021) via Our World in Data.
Author

Steven Ponce

Published

April 21, 2026

Figure 1: Area chart showing the share of the world population living in extreme poverty from 1820 to 2018. A shaded band across the top of the chart marks the historical pre-modern baseline of 75–90%, indicating that extreme poverty was the default human condition before industrialization. The line holds near 79% through the 19th century, declines gradually to 46% by 1980, then drops sharply to 8.6% by 2018, with the post-1980 decline shown in a darker fill to emphasize the acceleration.

Steps to Create this Graphic

1. Load Packages & Setup

Show code
```{r}
#| label: load
#| warning: false
#| message: false      
#| results: "hide"     

## 1. LOAD PACKAGES & SETUP ----
suppressPackageStartupMessages({
pacman::p_load(
  tidyverse, ggtext, showtext, 
  janitor, scales, glue
  )
})

### |- figure size ----
camcorder::gg_record(
  dir    = here::here("temp_plots"),
  device = "png",
  width  = 10,
  height = 8,
  units  = "in",
  dpi    = 320
)

# Source utility functions
suppressMessages(source(here::here("R/utils/fonts.R")))
source(here::here("R/utils/social_icons.R"))
source(here::here("R/utils/image_utils.R"))
source(here::here("R/themes/base_theme.R"))
```

2. Read in the Data

Show code
```{r}
#| label: read
#| include: true
#| eval: true
#| warning: false

### |- Poverty data 1820-2018 ----
poverty_raw <- read_csv(
  here::here("data/30DayChartChallenge/2026/owid_extreme_poverty_historical.csv"),
  show_col_types = FALSE
)
```

3. Examine the Data

Show code
```{r}
#| label: examine
#| include: true
#| eval: true
#| results: 'hide'
#| warning: false

glimpse(poverty_raw)
```

4. Tidy Data

Show code
```{r}
#| label: tidy
#| warning: false

### |- Wold poverty share 1820-2018 ----
poverty <- poverty_raw |>
  filter(entity == "World") |>
  rename(poverty_share = 4) |> 
  select(year, poverty_share) |>
  filter(!is.na(poverty_share)) |>
  arrange(year) |>
  # Flag pre-1981 data as uncertain (decadal estimates)
  mutate(uncertain = year < 1981)

### |- split into two segments for dual-alpha rendering ----
poverty_early <- poverty |> filter(uncertain)
poverty_recent <- poverty |> filter(!uncertain)

### |- annotation data ----
# Key anchors: start value, inflection point (~1980), end value
val_start  <- poverty |> filter(year == min(year)) |> pull(poverty_share)
val_end    <- poverty |> filter(year == max(year)) |> pull(poverty_share)
yr_start   <- poverty |> filter(year == min(year)) |> pull(year)
yr_end     <- poverty |> filter(year == max(year)) |> pull(year)

# Inflection: where slope steepens most sharply (visually ~1980)
val_1980   <- poverty |> filter(year == 1980 | year == 1981) |> slice(1) |> pull(poverty_share)
yr_inflect <- poverty |> filter(year == 1980 | year == 1981) |> slice(1) |> pull(year)
```

5. Visualization Parameters

Show code
```{r}
#| label: params
#| include: true
#| warning: false

### |- plot aesthetics ----
colors <- get_theme_colors(
  palette = list(
    bg         = "#F5F1EC",    
    line_main  = "#6B0F1A",     
    area_fill  = "#6B0F1A",   
    line_dim   = "#6B0F1A",    
    ref_band   = "#C8B8A2",    
    text_dark  = "#2C1A0E",    
    text_mid   = "#6B5744",     
    gridline   = "#DDD5C8"      
  )
)

### |- color scalars for use inside geom layers ----
col_line_main <- colors$palette$line_main
col_line_dim  <- colors$palette$line_dim
col_area      <- colors$palette$area_fill
col_ref_band  <- colors$palette$ref_band
col_text_dark <- colors$palette$text_dark
col_text_mid  <- colors$palette$text_mid
col_bg        <- colors$palette$bg

### |- titles and caption ----
title_text    <- "A Century of Stagnation. Four Decades of Change."

subtitle_text <- "Share of the world population living in extreme poverty (cost of basic needs approach), 1820–2018.<br>
Most of the decline occurs after 1980. Early estimates (pre-1981) carry uncertainty."

caption_text  <- create_dcc_caption(
  dcc_year    = 2026,
  dcc_day     = 21,
  source_text = "Moatsos (2021) via Our World in Data · Definition: <$1.90/day, 2011 int.-$"
)

### |- fonts ----
setup_fonts()
fonts <- get_font_families()

### |- base theme ----
base_theme <- create_base_theme(colors)

weekly_theme <- extend_weekly_theme(
  base_theme,
  theme(
    # Background
    plot.background = element_rect(fill = col_bg, color = NA),
    panel.background = element_rect(fill = col_bg, color = NA),

    # Grid — horizontal only, very faint
    panel.grid.major.y = element_line(color = colors$palette$gridline, linewidth = 0.25),
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank(),

    # Axes
    axis.ticks = element_blank(),
    axis.text = element_text(family = fonts$text, color = col_text_mid, size = 9),
    axis.title.x = element_blank(),
    axis.title.y = element_text(
      family = fonts$text, color = col_text_mid,
      size = 9, margin = margin(r = 8)
    ),

    # Titles
    plot.title = element_text(
      family = fonts$text, face = "bold", size = 16,
      color = col_text_dark, margin = margin(b = 6)
    ),
    plot.subtitle = element_markdown(
      family = fonts$text, size = 10, color = col_text_mid,
      lineheight = 1.4, margin = margin(b = 20)
    ),
    plot.caption = element_markdown(
      family = fonts$text, size = 7, color = col_text_mid,
      hjust = 0, margin = margin(t = 16)
    ),

    # Margins
    plot.margin = margin(t = 20, r = 30, b = 16, l = 20)
  )
)

theme_set(weekly_theme)
```

6. Plot

Show code
```{r}
#| label: plot
#| warning: false

### |- main plot ----
p <- ggplot() +

   annotate(
    "rect",
    xmin = 1820, xmax = 1960,
    ymin = 75, ymax = 90,
    fill = col_ref_band, alpha = 0.18
  ) +
  annotate(
    "text",
    x = yr_start + 5, y = 87.5,
    label = "Historical baseline\n(~75–90% of humanity)",
    hjust = 0, vjust = 0.5,
    family = fonts$text, size = 2.8, color = col_text_mid
  ) +
  geom_area(
    data = poverty_early,
    mapping = aes(x = year, y = poverty_share),
    fill = col_area, alpha = 0.10, color = NA
  ) +
  geom_area(
    data = poverty_recent,
    mapping = aes(x = year, y = poverty_share),
    fill = col_area, alpha = 0.2, color = NA
  ) +
  geom_line(
    data = poverty_early,
    mapping = aes(x = year, y = poverty_share),
    color = col_line_dim, linewidth = 0.55, alpha = 0.4,
    linetype = "solid"
  ) +
  geom_line(
    data = poverty_recent,
    mapping = aes(x = year, y = poverty_share),
    color = col_line_main, linewidth = 0.95
  ) +
  annotate(
    "point",
    x = yr_inflect, y = val_1980,
    color = col_line_main, size = 2.2, shape = 21,
    fill = col_bg, stroke = 1.2
  ) +
  annotate(
    "text",
    x = yr_inflect + 1, y = val_1980 + 2,
    label = glue("{round(val_1980)}% in {yr_inflect}"),
    hjust = 0, vjust = 0,
    family = fonts$text, size = 2.9, color = col_text_dark,
    lineheight = 1.3
  ) +
  annotate(
    "point",
    x = yr_start, y = val_start,
    color = col_line_dim, size = 2, shape = 21,
    fill = col_bg, stroke = 1
  ) +
  annotate(
    "text",
    x = yr_start + 2, y = val_start - 4,
    label = glue("{round(val_start)}%\n({yr_start})"),
    hjust = 0, vjust = 1,
    family = fonts$text, size = 2.9, color = col_text_mid,
    lineheight = 1.3
  ) +
  annotate(
    "point",
    x = yr_end, y = val_end,
    color = col_line_main, size = 2.2, shape = 21,
    fill = col_bg, stroke = 1.2
  ) +
  annotate(
    "text",
    x = yr_end + 1, y = val_end + 6,
    # label = glue("{round(val_end, 1)}%\ntoday"),
    label = glue("{round(val_end, 1)}%\n(2018)"),
    hjust = 1, vjust = 0,
    family = fonts$text, size = 2.9, color = col_text_dark,
    lineheight = 1.3
  ) +
  scale_x_continuous(
    breaks = pretty_breaks(),
    expand = expansion(mult = c(0.02, 0.03))
  ) +
  scale_y_continuous(
    limits = c(0, 100),
    breaks = c(0, 25, 50, 75, 100),
    labels = label_percent(scale = 1),
    expand = expansion(mult = c(0.02, 0.04))
  ) +
  labs(
    title    = title_text,
    subtitle = subtitle_text,
    caption  = caption_text,
    y        = "Share in extreme poverty (%)"
  )
```

7. Save

Show code
```{r}
#| label: save
#| warning: false

### |-  plot image ----  
save_plot(
  p, 
  type = "30daychartchallenge", 
  year = 2026, 
  day = 21, 
  width = 10, 
  height = 8
  )
```

8. Session Info

TipExpand for Session Info
R version 4.5.3 (2026-03-11 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default
  LAPACK version 3.12.1

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] here_1.0.2      glue_1.8.0      scales_1.4.0    janitor_2.2.1  
 [5] showtext_0.9-8  showtextdb_3.0  sysfonts_0.8.9  ggtext_0.1.2   
 [9] lubridate_1.9.5 forcats_1.0.1   stringr_1.6.0   dplyr_1.2.1    
[13] purrr_1.2.2     readr_2.2.0     tidyr_1.3.2     tibble_3.3.1   
[17] ggplot2_4.0.2   tidyverse_2.0.0

loaded via a namespace (and not attached):
 [1] gtable_0.3.6       xfun_0.57          htmlwidgets_1.6.4  tzdb_0.5.0        
 [5] vctrs_0.7.3        tools_4.5.3        generics_0.1.4     curl_7.0.0        
 [9] parallel_4.5.3     gifski_1.32.0-2    pacman_0.5.1       pkgconfig_2.0.3   
[13] RColorBrewer_1.1-3 S7_0.2.1           lifecycle_1.0.5    compiler_4.5.3    
[17] farver_2.1.2       textshaping_1.0.5  codetools_0.2-20   snakecase_0.11.1  
[21] litedown_0.9       htmltools_0.5.9    yaml_2.3.12        pillar_1.11.1     
[25] crayon_1.5.3       camcorder_0.1.0    magick_2.9.1       commonmark_2.0.0  
[29] tidyselect_1.2.1   digest_0.6.39      stringi_1.8.7      rsvg_2.7.0        
[33] rprojroot_2.1.1    fastmap_1.2.0      grid_4.5.3         cli_3.6.6         
[37] magrittr_2.0.5     withr_3.0.2        bit64_4.6.0-1      timechange_0.4.0  
[41] rmarkdown_2.31     bit_4.6.0          otel_0.2.0         ragg_1.5.2        
[45] hms_1.1.4          evaluate_1.0.5     knitr_1.51         markdown_2.0      
[49] rlang_1.2.0        gridtext_0.1.6     Rcpp_1.1.1         xml2_1.5.2        
[53] svglite_2.2.2      rstudioapi_0.18.0  vroom_1.7.1        jsonlite_2.0.0    
[57] R6_2.6.1           systemfonts_1.3.2 

9. GitHub Repository

TipExpand for GitHub Repo

The complete code for this analysis is available in 30dcc_2026_21.qmd.

For the full repository, click here.

10. References

TipExpand for References
  1. Data Sources:
    • Moatsos, M. (2021). Global extreme poverty: Present and past since 1820. In OECD, How Was Life? Volume II. Accessed via Our World in Data. Series: ‘Cost of basic needs’ approach, World entity, 1820–2018. Definition: Living on less than 1.90/day in 2011 international-. https://ourworldindata.org/grapher/share-of-population-living-in-extreme-poverty
  2. Methodology Note:
    • Pre-1981 values are decadal estimates with meaningful uncertainty; rendered at reduced opacity to signal this without removing historical context.

11. Custom Functions Documentation

Note📦 Custom Helper Functions

This analysis uses custom functions from my personal module library for efficiency and consistency across projects.

Functions Used:

  • fonts.R: setup_fonts(), get_font_families() - Font management with showtext
  • social_icons.R: create_social_caption() - Generates formatted social media captions
  • image_utils.R: save_plot() - Consistent plot saving with naming conventions
  • base_theme.R: create_base_theme(), extend_weekly_theme(), get_theme_colors() - Custom ggplot2 themes

Why custom functions?
These utilities standardize theming, fonts, and output across all my data visualizations. The core analysis (data tidying and visualization logic) uses only standard tidyverse packages.

Source Code:
View all custom functions → GitHub: R/utils

Back to top

Citation

BibTeX citation:
@online{ponce2026,
  author = {Ponce, Steven},
  title = {A {Century} of {Stagnation.} {Four} {Decades} of {Change.}},
  date = {2026-04-21},
  url = {https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_21.html},
  langid = {en}
}
For attribution, please cite this work as:
Ponce, Steven. 2026. “A Century of Stagnation. Four Decades of Change.” April 21, 2026. https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_21.html.
Source Code
---
title: "A Century of Stagnation. Four Decades of Change."
subtitle: "Share of the world population living in extreme poverty (cost of basic needs approach), 1820–2018. Most of the decline occurs after 1980. Early estimates (pre-1981) carry uncertainty."
description: "Share of the world population living in extreme poverty (cost-of-basic-needs approach), 1820–2018. Most of the decline occurred after 1980. Early estimates (pre-1981) are subject to uncertainty. Built with ggplot2 in R using data from Moatsos (2021) via Our World in Data."
date: "2026-04-21" 
author:
  - name: "Steven Ponce"
    url: "https://stevenponce.netlify.app"
citation:
  url: "https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_21.html"
categories: ["30DayChartChallenge", "Data Visualization", "R Programming", "2026"]
tags: [
  "30DayChartChallenge",
  "Timeseries",
  "Historical",
  "Extreme Poverty",
  "Global Development",
  "Area Chart",
  "Our World in Data",
  "Moatsos",
  "Economic History",
  "ggplot2",
  "patchwork",
  "ggtext",
  "R Programming"
]
image: "thumbnails/30dcc_2026_21.png"
format:
  html:
    toc: true
    toc-depth: 5
    code-link: true
    code-fold: true
    code-tools: true
    code-summary: "Show code"
    self-contained: true
    theme: 
      light: [flatly, assets/styling/custom_styles.scss]
      dark: [darkly, assets/styling/custom_styles_dark.scss]
editor_options: 
  chunk_output_type: inline
execute: 
  freeze: true                                                  
  cache: true                                                   
  error: false
  message: false
  warning: false
  eval: true
---

![Area chart showing the share of the world population living in extreme poverty from 1820 to 2018. A shaded band across the top of the chart marks the historical pre-modern baseline of 75–90%, indicating that extreme poverty was the default human condition before industrialization. The line holds near 79% through the 19th century, declines gradually to 46% by 1980, then drops sharply to 8.6% by 2018, with the post-1980 decline shown in a darker fill to emphasize the acceleration.](30dcc_2026_21.png){#fig-1}

### [**Steps to Create this Graphic**]{.mark}

#### [1. Load Packages & Setup]{.smallcaps}

```{r}
#| label: load
#| warning: false
#| message: false      
#| results: "hide"     

## 1. LOAD PACKAGES & SETUP ----
suppressPackageStartupMessages({
pacman::p_load(
  tidyverse, ggtext, showtext, 
  janitor, scales, glue
  )
})

### |- figure size ----
camcorder::gg_record(
  dir    = here::here("temp_plots"),
  device = "png",
  width  = 10,
  height = 8,
  units  = "in",
  dpi    = 320
)

# Source utility functions
suppressMessages(source(here::here("R/utils/fonts.R")))
source(here::here("R/utils/social_icons.R"))
source(here::here("R/utils/image_utils.R"))
source(here::here("R/themes/base_theme.R"))
```

#### [2. Read in the Data]{.smallcaps}

```{r}
#| label: read
#| include: true
#| eval: true
#| warning: false

### |- Poverty data 1820-2018 ----
poverty_raw <- read_csv(
  here::here("data/30DayChartChallenge/2026/owid_extreme_poverty_historical.csv"),
  show_col_types = FALSE
)
```

#### [3. Examine the Data]{.smallcaps}

```{r}
#| label: examine
#| include: true
#| eval: true
#| results: 'hide'
#| warning: false

glimpse(poverty_raw)
```

#### [4. Tidy Data]{.smallcaps}

```{r}
#| label: tidy
#| warning: false

### |- Wold poverty share 1820-2018 ----
poverty <- poverty_raw |>
  filter(entity == "World") |>
  rename(poverty_share = 4) |> 
  select(year, poverty_share) |>
  filter(!is.na(poverty_share)) |>
  arrange(year) |>
  # Flag pre-1981 data as uncertain (decadal estimates)
  mutate(uncertain = year < 1981)

### |- split into two segments for dual-alpha rendering ----
poverty_early <- poverty |> filter(uncertain)
poverty_recent <- poverty |> filter(!uncertain)

### |- annotation data ----
# Key anchors: start value, inflection point (~1980), end value
val_start  <- poverty |> filter(year == min(year)) |> pull(poverty_share)
val_end    <- poverty |> filter(year == max(year)) |> pull(poverty_share)
yr_start   <- poverty |> filter(year == min(year)) |> pull(year)
yr_end     <- poverty |> filter(year == max(year)) |> pull(year)

# Inflection: where slope steepens most sharply (visually ~1980)
val_1980   <- poverty |> filter(year == 1980 | year == 1981) |> slice(1) |> pull(poverty_share)
yr_inflect <- poverty |> filter(year == 1980 | year == 1981) |> slice(1) |> pull(year)

```


#### [5. Visualization Parameters]{.smallcaps}

```{r}
#| label: params
#| include: true
#| warning: false

### |- plot aesthetics ----
colors <- get_theme_colors(
  palette = list(
    bg         = "#F5F1EC",    
    line_main  = "#6B0F1A",     
    area_fill  = "#6B0F1A",   
    line_dim   = "#6B0F1A",    
    ref_band   = "#C8B8A2",    
    text_dark  = "#2C1A0E",    
    text_mid   = "#6B5744",     
    gridline   = "#DDD5C8"      
  )
)

### |- color scalars for use inside geom layers ----
col_line_main <- colors$palette$line_main
col_line_dim  <- colors$palette$line_dim
col_area      <- colors$palette$area_fill
col_ref_band  <- colors$palette$ref_band
col_text_dark <- colors$palette$text_dark
col_text_mid  <- colors$palette$text_mid
col_bg        <- colors$palette$bg

### |- titles and caption ----
title_text    <- "A Century of Stagnation. Four Decades of Change."

subtitle_text <- "Share of the world population living in extreme poverty (cost of basic needs approach), 1820–2018.<br>
Most of the decline occurs after 1980. Early estimates (pre-1981) carry uncertainty."

caption_text  <- create_dcc_caption(
  dcc_year    = 2026,
  dcc_day     = 21,
  source_text = "Moatsos (2021) via Our World in Data · Definition: <$1.90/day, 2011 int.-$"
)

### |- fonts ----
setup_fonts()
fonts <- get_font_families()

### |- base theme ----
base_theme <- create_base_theme(colors)

weekly_theme <- extend_weekly_theme(
  base_theme,
  theme(
    # Background
    plot.background = element_rect(fill = col_bg, color = NA),
    panel.background = element_rect(fill = col_bg, color = NA),

    # Grid — horizontal only, very faint
    panel.grid.major.y = element_line(color = colors$palette$gridline, linewidth = 0.25),
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank(),

    # Axes
    axis.ticks = element_blank(),
    axis.text = element_text(family = fonts$text, color = col_text_mid, size = 9),
    axis.title.x = element_blank(),
    axis.title.y = element_text(
      family = fonts$text, color = col_text_mid,
      size = 9, margin = margin(r = 8)
    ),

    # Titles
    plot.title = element_text(
      family = fonts$text, face = "bold", size = 16,
      color = col_text_dark, margin = margin(b = 6)
    ),
    plot.subtitle = element_markdown(
      family = fonts$text, size = 10, color = col_text_mid,
      lineheight = 1.4, margin = margin(b = 20)
    ),
    plot.caption = element_markdown(
      family = fonts$text, size = 7, color = col_text_mid,
      hjust = 0, margin = margin(t = 16)
    ),

    # Margins
    plot.margin = margin(t = 20, r = 30, b = 16, l = 20)
  )
)

theme_set(weekly_theme)

```

#### [6. Plot]{.smallcaps}

```{r}
#| label: plot
#| warning: false

### |- main plot ----
p <- ggplot() +

   annotate(
    "rect",
    xmin = 1820, xmax = 1960,
    ymin = 75, ymax = 90,
    fill = col_ref_band, alpha = 0.18
  ) +
  annotate(
    "text",
    x = yr_start + 5, y = 87.5,
    label = "Historical baseline\n(~75–90% of humanity)",
    hjust = 0, vjust = 0.5,
    family = fonts$text, size = 2.8, color = col_text_mid
  ) +
  geom_area(
    data = poverty_early,
    mapping = aes(x = year, y = poverty_share),
    fill = col_area, alpha = 0.10, color = NA
  ) +
  geom_area(
    data = poverty_recent,
    mapping = aes(x = year, y = poverty_share),
    fill = col_area, alpha = 0.2, color = NA
  ) +
  geom_line(
    data = poverty_early,
    mapping = aes(x = year, y = poverty_share),
    color = col_line_dim, linewidth = 0.55, alpha = 0.4,
    linetype = "solid"
  ) +
  geom_line(
    data = poverty_recent,
    mapping = aes(x = year, y = poverty_share),
    color = col_line_main, linewidth = 0.95
  ) +
  annotate(
    "point",
    x = yr_inflect, y = val_1980,
    color = col_line_main, size = 2.2, shape = 21,
    fill = col_bg, stroke = 1.2
  ) +
  annotate(
    "text",
    x = yr_inflect + 1, y = val_1980 + 2,
    label = glue("{round(val_1980)}% in {yr_inflect}"),
    hjust = 0, vjust = 0,
    family = fonts$text, size = 2.9, color = col_text_dark,
    lineheight = 1.3
  ) +
  annotate(
    "point",
    x = yr_start, y = val_start,
    color = col_line_dim, size = 2, shape = 21,
    fill = col_bg, stroke = 1
  ) +
  annotate(
    "text",
    x = yr_start + 2, y = val_start - 4,
    label = glue("{round(val_start)}%\n({yr_start})"),
    hjust = 0, vjust = 1,
    family = fonts$text, size = 2.9, color = col_text_mid,
    lineheight = 1.3
  ) +
  annotate(
    "point",
    x = yr_end, y = val_end,
    color = col_line_main, size = 2.2, shape = 21,
    fill = col_bg, stroke = 1.2
  ) +
  annotate(
    "text",
    x = yr_end + 1, y = val_end + 6,
    # label = glue("{round(val_end, 1)}%\ntoday"),
    label = glue("{round(val_end, 1)}%\n(2018)"),
    hjust = 1, vjust = 0,
    family = fonts$text, size = 2.9, color = col_text_dark,
    lineheight = 1.3
  ) +
  scale_x_continuous(
    breaks = pretty_breaks(),
    expand = expansion(mult = c(0.02, 0.03))
  ) +
  scale_y_continuous(
    limits = c(0, 100),
    breaks = c(0, 25, 50, 75, 100),
    labels = label_percent(scale = 1),
    expand = expansion(mult = c(0.02, 0.04))
  ) +
  labs(
    title    = title_text,
    subtitle = subtitle_text,
    caption  = caption_text,
    y        = "Share in extreme poverty (%)"
  )
```

#### [7. Save]{.smallcaps}

```{r}
#| label: save
#| warning: false

### |-  plot image ----  
save_plot(
  p, 
  type = "30daychartchallenge", 
  year = 2026, 
  day = 21, 
  width = 10, 
  height = 8
  )
```

#### [8. Session Info]{.smallcaps}

::: {.callout-tip collapse="true"}
##### Expand for Session Info

```{r, echo = FALSE}
#| eval: true
#| warning: false

sessionInfo()
```
:::

#### [9. GitHub Repository]{.smallcaps} 

::: {.callout-tip collapse="true"}
##### Expand for GitHub Repo

The complete code for this analysis is available in [`30dcc_2026_21.qmd`](https://github.com/poncest/personal-website/blob/master/data_visualizations/TidyTuesday/2026/30dcc_2026_21.qmd).

For the full repository, [click here](https://github.com/poncest/personal-website/).
:::


#### [10. References]{.smallcaps}
::: {.callout-tip collapse="true"}
##### Expand for References
1. **Data Sources:**
   - Moatsos, M. (2021). Global extreme poverty: Present and past since 1820.
     In OECD, *How Was Life? Volume II*.
     Accessed via Our World in Data.
     Series: 'Cost of basic needs' approach, World entity, 1820–2018.
     Definition: Living on less than $1.90/day in 2011 international-$.
     https://ourworldindata.org/grapher/share-of-population-living-in-extreme-poverty

2. **Methodology Note:**
   - Pre-1981 values are decadal estimates with meaningful uncertainty;
     rendered at reduced opacity to signal this without removing historical context.
:::


#### [11. Custom Functions Documentation]{.smallcaps}

::: {.callout-note collapse="true"}
##### 📦 Custom Helper Functions

This analysis uses custom functions from my personal module library for efficiency and consistency across projects.

**Functions Used:**

-   **`fonts.R`**: `setup_fonts()`, `get_font_families()` - Font management with showtext
-   **`social_icons.R`**: `create_social_caption()` - Generates formatted social media captions
-   **`image_utils.R`**: `save_plot()` - Consistent plot saving with naming conventions
-   **`base_theme.R`**: `create_base_theme()`, `extend_weekly_theme()`, `get_theme_colors()` - Custom ggplot2 themes

**Why custom functions?**\
These utilities standardize theming, fonts, and output across all my data visualizations. The core analysis (data tidying and visualization logic) uses only standard tidyverse packages.

**Source Code:**\
View all custom functions → [GitHub: R/utils](https://github.com/poncest/personal-website/tree/master/R)
:::

© 2024 Steven Ponce

Source Issues