• 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

When warmth stops looking exceptional

  • Show All Code
  • Hide All Code

  • View Source

Each curve shows the distribution of monthly temperature anomalies by decade (°C, vs. 1951–1980 mean). Width = variability (uncertainty). Position = signal. Early decades are wide and centered near zero — later decades are narrower and shifted right. Uncertainty gives way to persistence

30DayChartChallenge
Data Visualization
R Programming
2026
A ridgeline chart showing how monthly global temperature anomalies have shifted over seven decades. Using a single burgundy color scale, each curve reveals both the variability (width) and the signal (position) for a given decade. Early decades fluctuate broadly around the 1951–1980 baseline. By the 2010s and 2020s, the distributions have narrowed and shifted decisively to the right — uncertainty gives way to persistence. Built with R, ggplot2, and ggridges using NASA GISS GISTEMP v4 data.
Author

Steven Ponce

Published

April 29, 2026

Figure 1: Ridgeline chart showing the distribution of monthly global temperature anomalies by decade from the 1950s to the 2020s, with a single burgundy color scale: lighter shades represent earlier decades, and darker shades represent more recent ones. Each curve’s width encodes variability. The 1950s and 1960s show wide, symmetric distributions centered near the 1951-1980 baseline of zero, while later decades show narrower distributions shifted to the right. The 2010s and 2020s curves, rendered in near-black oxblood, sit almost entirely above +0.5°C, showing that month-to-month uncertainty persists but the underlying warming signal has become consistent. A dashed vertical line marks the zero baseline. Two annotations frame the uncertainty-to-signal transition: “Wide = more uncertain” on the left and “Shifted right = persistent warmth” on the right. Title reads: “When warmth stops looking exceptional.” Data source: NASA GISS Surface Temperature Analysis (GISTEMP v4).

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, camcorder, ggridges 
  )
})

### |- figure size ----
camcorder::gg_record(
  dir    = here::here("temp_plots"),
  device = "png",
  width  = 10,
  height = 7,
  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

### |- cache path ----
data_path <- here::here("data/30DayChartChallenge/2026/gistemp_global_monthly.csv")

### |- fetch or load ----
# if (!file.exists(data_path)) {
#   url <- "https://data.giss.nasa.gov/gistemp/tabledata_v4/GLB.Ts+dSST.csv"
#   download.file(url, destfile = data_path, mode = "wb")
#   message("Downloaded GISTEMP data to: ", data_path)
# } else {
#   message("Using cached GISTEMP data.")
# }

### |- raw read ----
# NASA GISS format: first row is header info, second row is column names
# Anomalies in units of 0.01°C in older files; v4 is in °C directly
# File has a header comment row — skip = 1 handles it
raw <- read_csv(
  data_path,
  skip    = 1,
  na      = c("***", "****", ""),
  show_col_types = FALSE
)
```

3. Examine the Data

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

glimpse(raw)
```

4. Tidy Data

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

### |- month columns only, pivot long ----
month_cols <- c(
  "Jan", "Feb", "Mar", "Apr", "May", "Jun",
  "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
)

df <- raw |>
  clean_names() |>
  select(year, all_of(tolower(month_cols))) |>
  filter(year >= 1950, year <= 2024) |>
  pivot_longer(
    cols = -year,
    names_to = "month_abbr",
    values_to = "anomaly"
  ) |>
  mutate(anomaly = as.numeric(anomaly)) |>
  filter(!is.na(anomaly))

### |- assign decade labels ----
df <- df |>
  mutate(
    decade = floor(year / 10) * 10,
    decade_label = paste0(decade, "s"),
    decade_fct = factor(decade_label, levels = rev(paste0(seq(1950, 2020, 10), "s")))
  )

### |- decade summary stats (for annotation anchors) ----
decade_stats <- df |>
  group_by(decade, decade_label, decade_fct) |>
  summarise(
    mean_anom = mean(anomaly, na.rm = TRUE),
    sd_anom = sd(anomaly, na.rm = TRUE),
    .groups = "drop"
  )
```

5. Visualization Parameters

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

### |- plot aesthetics ----
colors <- get_theme_colors(
  palette = list(
    bg     = "#F5F3EE",   
    low    = "#EAD9D5",   
    mid_lo = "#C17B7B",   
    mid_hi = "#8B3030",   
    hi     = "#3D0C0C",   
    text   = "#2C2825",   
    subtle = "#7A7068",   
    grid   = "#E8E4DE"    
  )
)

# pre-extract scalar color values  
col_bg     <- colors$palette$bg
col_subtle <- colors$palette$subtle
col_mid_hi <- colors$palette$mid_hi
col_grid   <- colors$palette$grid
col_text   <- colors$palette$text

# Decade fill ramp: 8 stops, lightest (1950s) → darkest (2020s)
decade_fills <- c(
  "1950s" = "#EAD9D5",
  "1960s" = "#DDB8B1",
  "1970s" = "#CC9590",
  "1980s" = "#B86E6E",
  "1990s" = "#9E4A4A",
  "2000s" = "#8B3030",
  "2010s" = "#611818",
  "2020s" = "#3D0C0C"
)

### |- titles and caption ----
title_text <- "When warmth stops looking exceptional"

subtitle_text <- glue(
  "Each curve shows the distribution of monthly temperature anomalies by decade ",
  "(°C, vs. 1951–1980 mean).<br>",
  "**Width** = variability (uncertainty). **Position** = signal. ",
  "Early decades are wide and centered near zero — later decades are<br>",
  "narrower and shifted right. Uncertainty gives way to persistence."
)

caption_text <- create_dcc_caption(
  dcc_year    = 2026,
  dcc_day     = 29,
  source_text = "NASA GISS Surface Temperature Analysis (GISTEMP v4)"
)

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

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

weekly_theme <- extend_weekly_theme(
  base_theme,
  theme(
    
    plot.background = element_rect(fill = col_bg, color = NA),
    panel.background = element_rect(fill = col_bg, color = NA),
    
    panel.grid.major.x = element_line(color = col_grid, linewidth = 0.25),
    panel.grid.major.y = element_blank(),
    panel.grid.minor = element_blank(),
    
    axis.ticks = element_blank(),
    axis.text.x = element_text(
      family = fonts$text, size = 8,
      color  = col_subtle, margin = margin(t = 4)
    ),
    axis.text.y = element_text(
      family = fonts$text, size = 9,
      color  = col_subtle, hjust = 1
    ),
    axis.title.x = element_text(
      family = fonts$text, size = 8,
      color  = col_subtle, margin = margin(t = 8)
    ),
    axis.title.y = element_blank(),
    
    plot.title = element_text(
      family = fonts$title,
      face = "bold",
      size = 20,
      color = col_text,
      margin = margin(b = 6)
    ),
    plot.subtitle = element_markdown(
      family = fonts$text,
      size = 9.5,
      color = col_subtle,
      lineheight = 1.5,
      margin = margin(b = 16)
    ),
    plot.caption = element_markdown(
      family = fonts$text,
      size = 7,
      color = col_subtle,
      hjust = 1,
      margin = margin(t = 12)
    ),
    
    legend.position = "none",
    plot.margin = margin(20, 24, 10, 20)
  )
)

theme_set(weekly_theme)
```

6. Plot

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

### |- main plot ----
p <- df |>
  ggplot(aes(x = anomaly, y = decade_fct, fill = decade_fct)) +

  # Geoms
  geom_vline(
    xintercept = 0,
    color = col_subtle,
    linewidth = 0.35,
    linetype = "dashed"
  ) +
  geom_density_ridges(
    scale = 1.6,
    rel_min_height = 0.005,
    bandwidth = 0.08,
    color = NA,
    alpha = 0.82
  ) +
  geom_point(
    data = decade_stats,
    aes(x = mean_anom, y = decade_fct),
    color = col_bg,
    fill = col_bg,
    size = 1.6,
    shape = 21,
    stroke = 0.4
  ) +

  # Scales
  scale_fill_manual(values = decade_fills, guide = "none") +
  scale_x_continuous(
    breaks = seq(-1, 1.5, by = 0.5),
    labels = function(x) ifelse(x == 0, "0", sprintf("%+.1f", x)),
    expand = expansion(add = c(0.05, 0.15))
  ) +

  # Annotate
  annotate(
    "text",
    x = -0.9, y = 1.4,
    label = "Wide = more uncertain",
    hjust = 0, vjust = 0,
    size = 2.8,
    family = fonts$text,
    color = col_subtle,
    fontface = "italic"
  ) +
  annotate(
    "segment",
    x = -0.55, xend = -0.15,
    y = 1.65,  yend = 1.65,
    arrow = arrow(length = unit(4, "pt"), type = "open"),
    color = col_subtle,
    linewidth = 0.35
  ) +
  annotate(
    "text",
    x = 0.9, y = 7.6,
    label = "Shifted right = persistent warmth",
    hjust = 0, vjust = 0,
    size = 2.8,
    family = fonts$text,
    color = col_mid_hi,
    fontface = "italic"
  ) +
  annotate(
    "segment",
    x = 0.85, xend = 0.62,
    y = 7.85, yend = 7.85,
    arrow = arrow(length = unit(4, "pt"), type = "open"),
    color = col_mid_hi,
    linewidth = 0.35
  ) +
  annotate(
    "text",
    x = 0.03, y = 8.6,
    label = "baseline\n(1951–1980)",
    hjust = 0, vjust = 1,
    size = 2.4,
    family = fonts$text,
    color = col_subtle,
    fontface = "italic",
    lineheight = 1.1
  ) +

  # Labs
  labs(
    title = title_text,
    subtitle = subtitle_text,
    caption  = caption_text,
    x = "Temperature anomaly (°C)",
    y = NULL
  )
```

7. Save

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

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

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      ggridges_0.5.7  camcorder_0.1.0 glue_1.8.0     
 [5] scales_1.4.0    janitor_2.2.1   showtext_0.9-8  showtextdb_3.0 
 [9] sysfonts_0.8.9  ggtext_0.1.2    lubridate_1.9.5 forcats_1.0.1  
[13] stringr_1.6.0   dplyr_1.2.1     purrr_1.2.2     readr_2.2.0    
[17] tidyr_1.3.2     tibble_3.3.1    ggplot2_4.0.3   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       magick_2.9.1       commonmark_2.0.0   tidyselect_1.2.1  
[29] digest_0.6.39      stringi_1.8.7      rsvg_2.7.0         rprojroot_2.1.1   
[33] fastmap_1.2.0      grid_4.5.3         cli_3.6.6          magrittr_2.0.5    
[37] withr_3.0.2        bit64_4.6.0-1      timechange_0.4.0   rmarkdown_2.31    
[41] bit_4.6.0          otel_0.2.0         ragg_1.5.2         hms_1.1.4         
[45] evaluate_1.0.5     knitr_1.51         markdown_2.0       rlang_1.2.0       
[49] gridtext_0.1.6     Rcpp_1.1.1         xml2_1.5.2         svglite_2.2.2     
[53] rstudioapi_0.18.0  vroom_1.7.1        jsonlite_2.0.0     R6_2.6.1          
[57] systemfonts_1.3.2 

9. GitHub Repository

TipExpand for GitHub Repo

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

For the full repository, click here.

10. References

TipExpand for References
  1. Data Sources:
    • GISTEMP Team (2024). GISS Surface Temperature Analysis (GISTEMP), version 4. NASA Goddard Institute for Space Studies. Retrieved from: https://data.giss.nasa.gov/gistemp/
  2. Key Datasets:
    • GLB.Ts+dSST.csv — Monthly global surface temperature anomalies, 1880–2024, relative to the 1951–1980 baseline mean (°C). Combines land-surface air temperature and sea-surface water temperature.

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 = {When Warmth Stops Looking Exceptional},
  date = {2026-04-29},
  url = {https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_29.html},
  langid = {en}
}
For attribution, please cite this work as:
Ponce, Steven. 2026. “When Warmth Stops Looking Exceptional.” April 29, 2026. https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_29.html.
Source Code
---
title: "When warmth stops looking exceptional"
subtitle: "Each curve shows the distribution of monthly temperature anomalies by decade (°C, vs. 1951–1980 mean). Width = variability (uncertainty). Position = signal. Early decades are wide and centered near zero — later decades are narrower and shifted right. Uncertainty gives way to persistence"
description: "A ridgeline chart showing how monthly global temperature anomalies have shifted over seven decades. Using a single burgundy color scale, each curve reveals both the variability (width) and the signal (position) for a given decade. Early decades fluctuate broadly around the 1951–1980 baseline. By the 2010s and 2020s, the distributions have narrowed and shifted decisively to the right — uncertainty gives way to persistence. Built with R, ggplot2, and ggridges using NASA GISS GISTEMP v4 data."
date: "2026-04-29" 
author:
  - name: "Steven Ponce"
    url: "https://stevenponce.netlify.app"
citation:
  url: "https://stevenponce.netlify.app/data_visualizations/30DayChartChallenge/2026/30dcc_2026_29.html"
categories: ["30DayChartChallenge", "Data Visualization", "R Programming", "2026"]
tags: [
  "30DayChartChallenge",
  "Uncertainties",
  "Monochrome",
  "Ridgeline Chart",
  "Distribution",
  "Climate",
  "Temperature Anomaly",
  "NASA GISS",
  "GISTEMP",
  "ggridges",
  "ggplot2",
  "Time Series"
]
image: "thumbnails/30dcc_2026_29.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
---

![Ridgeline chart showing the distribution of monthly global temperature anomalies by decade from the 1950s to the 2020s, with a single burgundy color scale: lighter shades represent earlier decades, and darker shades represent more recent ones. Each curve's width encodes variability. The 1950s and 1960s show wide, symmetric distributions centered near the 1951-1980 baseline of zero, while later decades show narrower distributions shifted to the right. The 2010s and 2020s curves, rendered in near-black oxblood, sit almost entirely above +0.5°C, showing that month-to-month uncertainty persists but the underlying warming signal has become consistent. A dashed vertical line marks the zero baseline. Two annotations frame the uncertainty-to-signal transition: "Wide = more uncertain" on the left and "Shifted right = persistent warmth" on the right. Title reads: "When warmth stops looking exceptional." Data source: NASA GISS Surface Temperature Analysis (GISTEMP v4).](30dcc_2026_29.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, camcorder, ggridges 
  )
})

### |- figure size ----
camcorder::gg_record(
  dir    = here::here("temp_plots"),
  device = "png",
  width  = 10,
  height = 7,
  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

### |- cache path ----
data_path <- here::here("data/30DayChartChallenge/2026/gistemp_global_monthly.csv")

### |- fetch or load ----
# if (!file.exists(data_path)) {
#   url <- "https://data.giss.nasa.gov/gistemp/tabledata_v4/GLB.Ts+dSST.csv"
#   download.file(url, destfile = data_path, mode = "wb")
#   message("Downloaded GISTEMP data to: ", data_path)
# } else {
#   message("Using cached GISTEMP data.")
# }

### |- raw read ----
# NASA GISS format: first row is header info, second row is column names
# Anomalies in units of 0.01°C in older files; v4 is in °C directly
# File has a header comment row — skip = 1 handles it
raw <- read_csv(
  data_path,
  skip    = 1,
  na      = c("***", "****", ""),
  show_col_types = FALSE
)

```

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

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

glimpse(raw)
```

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

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

### |- month columns only, pivot long ----
month_cols <- c(
  "Jan", "Feb", "Mar", "Apr", "May", "Jun",
  "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
)

df <- raw |>
  clean_names() |>
  select(year, all_of(tolower(month_cols))) |>
  filter(year >= 1950, year <= 2024) |>
  pivot_longer(
    cols = -year,
    names_to = "month_abbr",
    values_to = "anomaly"
  ) |>
  mutate(anomaly = as.numeric(anomaly)) |>
  filter(!is.na(anomaly))

### |- assign decade labels ----
df <- df |>
  mutate(
    decade = floor(year / 10) * 10,
    decade_label = paste0(decade, "s"),
    decade_fct = factor(decade_label, levels = rev(paste0(seq(1950, 2020, 10), "s")))
  )

### |- decade summary stats (for annotation anchors) ----
decade_stats <- df |>
  group_by(decade, decade_label, decade_fct) |>
  summarise(
    mean_anom = mean(anomaly, na.rm = TRUE),
    sd_anom = sd(anomaly, na.rm = TRUE),
    .groups = "drop"
  )
```


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

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

### |- plot aesthetics ----
colors <- get_theme_colors(
  palette = list(
    bg     = "#F5F3EE",   
    low    = "#EAD9D5",   
    mid_lo = "#C17B7B",   
    mid_hi = "#8B3030",   
    hi     = "#3D0C0C",   
    text   = "#2C2825",   
    subtle = "#7A7068",   
    grid   = "#E8E4DE"    
  )
)

# pre-extract scalar color values  
col_bg     <- colors$palette$bg
col_subtle <- colors$palette$subtle
col_mid_hi <- colors$palette$mid_hi
col_grid   <- colors$palette$grid
col_text   <- colors$palette$text

# Decade fill ramp: 8 stops, lightest (1950s) → darkest (2020s)
decade_fills <- c(
  "1950s" = "#EAD9D5",
  "1960s" = "#DDB8B1",
  "1970s" = "#CC9590",
  "1980s" = "#B86E6E",
  "1990s" = "#9E4A4A",
  "2000s" = "#8B3030",
  "2010s" = "#611818",
  "2020s" = "#3D0C0C"
)

### |- titles and caption ----
title_text <- "When warmth stops looking exceptional"

subtitle_text <- glue(
  "Each curve shows the distribution of monthly temperature anomalies by decade ",
  "(°C, vs. 1951–1980 mean).<br>",
  "**Width** = variability (uncertainty). **Position** = signal. ",
  "Early decades are wide and centered near zero — later decades are<br>",
  "narrower and shifted right. Uncertainty gives way to persistence."
)

caption_text <- create_dcc_caption(
  dcc_year    = 2026,
  dcc_day     = 29,
  source_text = "NASA GISS Surface Temperature Analysis (GISTEMP v4)"
)

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

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

weekly_theme <- extend_weekly_theme(
  base_theme,
  theme(
    
    plot.background = element_rect(fill = col_bg, color = NA),
    panel.background = element_rect(fill = col_bg, color = NA),
    
    panel.grid.major.x = element_line(color = col_grid, linewidth = 0.25),
    panel.grid.major.y = element_blank(),
    panel.grid.minor = element_blank(),
    
    axis.ticks = element_blank(),
    axis.text.x = element_text(
      family = fonts$text, size = 8,
      color  = col_subtle, margin = margin(t = 4)
    ),
    axis.text.y = element_text(
      family = fonts$text, size = 9,
      color  = col_subtle, hjust = 1
    ),
    axis.title.x = element_text(
      family = fonts$text, size = 8,
      color  = col_subtle, margin = margin(t = 8)
    ),
    axis.title.y = element_blank(),
    
    plot.title = element_text(
      family = fonts$title,
      face = "bold",
      size = 20,
      color = col_text,
      margin = margin(b = 6)
    ),
    plot.subtitle = element_markdown(
      family = fonts$text,
      size = 9.5,
      color = col_subtle,
      lineheight = 1.5,
      margin = margin(b = 16)
    ),
    plot.caption = element_markdown(
      family = fonts$text,
      size = 7,
      color = col_subtle,
      hjust = 1,
      margin = margin(t = 12)
    ),
    
    legend.position = "none",
    plot.margin = margin(20, 24, 10, 20)
  )
)

theme_set(weekly_theme)
```

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

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

### |- main plot ----
p <- df |>
  ggplot(aes(x = anomaly, y = decade_fct, fill = decade_fct)) +

  # Geoms
  geom_vline(
    xintercept = 0,
    color = col_subtle,
    linewidth = 0.35,
    linetype = "dashed"
  ) +
  geom_density_ridges(
    scale = 1.6,
    rel_min_height = 0.005,
    bandwidth = 0.08,
    color = NA,
    alpha = 0.82
  ) +
  geom_point(
    data = decade_stats,
    aes(x = mean_anom, y = decade_fct),
    color = col_bg,
    fill = col_bg,
    size = 1.6,
    shape = 21,
    stroke = 0.4
  ) +

  # Scales
  scale_fill_manual(values = decade_fills, guide = "none") +
  scale_x_continuous(
    breaks = seq(-1, 1.5, by = 0.5),
    labels = function(x) ifelse(x == 0, "0", sprintf("%+.1f", x)),
    expand = expansion(add = c(0.05, 0.15))
  ) +

  # Annotate
  annotate(
    "text",
    x = -0.9, y = 1.4,
    label = "Wide = more uncertain",
    hjust = 0, vjust = 0,
    size = 2.8,
    family = fonts$text,
    color = col_subtle,
    fontface = "italic"
  ) +
  annotate(
    "segment",
    x = -0.55, xend = -0.15,
    y = 1.65,  yend = 1.65,
    arrow = arrow(length = unit(4, "pt"), type = "open"),
    color = col_subtle,
    linewidth = 0.35
  ) +
  annotate(
    "text",
    x = 0.9, y = 7.6,
    label = "Shifted right = persistent warmth",
    hjust = 0, vjust = 0,
    size = 2.8,
    family = fonts$text,
    color = col_mid_hi,
    fontface = "italic"
  ) +
  annotate(
    "segment",
    x = 0.85, xend = 0.62,
    y = 7.85, yend = 7.85,
    arrow = arrow(length = unit(4, "pt"), type = "open"),
    color = col_mid_hi,
    linewidth = 0.35
  ) +
  annotate(
    "text",
    x = 0.03, y = 8.6,
    label = "baseline\n(1951–1980)",
    hjust = 0, vjust = 1,
    size = 2.4,
    family = fonts$text,
    color = col_subtle,
    fontface = "italic",
    lineheight = 1.1
  ) +

  # Labs
  labs(
    title = title_text,
    subtitle = subtitle_text,
    caption  = caption_text,
    x = "Temperature anomaly (°C)",
    y = NULL
  )
```

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

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

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

#### [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_29.qmd`](https://github.com/poncest/personal-website/blob/master/data_visualizations/TidyTuesday/2026/30dcc_2026_29.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:**
   - GISTEMP Team (2024). *GISS Surface Temperature Analysis (GISTEMP), version 4.*
     NASA Goddard Institute for Space Studies. Retrieved from:
     https://data.giss.nasa.gov/gistemp/

2. **Key Datasets:**
   - `GLB.Ts+dSST.csv` — Monthly global surface temperature anomalies, 1880–2024,
     relative to the 1951–1980 baseline mean (°C). Combines land-surface air temperature
     and sea-surface water temperature.

:::


#### [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