plot_temp_change <- temp_change |>
ggplot(aes(x = country, y = change, fill = variable)) +
geom_col(position = position_dodge(width = 0.8), width = 0.7) +
geom_text(
aes(
label = change_label,
hjust = ifelse(change >= 0, -0.08, 1.08)
),
position = position_dodge(width = 0.8),
size = 3.5,
color = "black"
) +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "grey20",
linewidth = 0.75
) +
coord_flip(clip = "off") +
scale_fill_manual(
values = c("Max Temp" = "#fdae61", "Min Temp" = "#91bfdb"),
name = NULL
) +
scale_y_continuous(
expand = expansion(mult = c(0.15, 0.15)),
breaks = pretty_breaks(n = 8)
) +
labs(
title = paste0(
"Change in mean annual temperature (",
early_start, "-", early_end, " to ",
recent_start, "-", recent_end, ")"
),
subtitle = "Average change in station temperatures per country",
x = NULL,
y = "Change (°C)",
caption = "Averages attained by averaging at the station level for the period, then annually, then per country.\nData: UK Met Office | Visualisation: Lewis TJ Ward"
) +
theme_tt() +
theme(
panel.grid.major.y = element_blank(),
panel.grid.major.x = element_line(color = "grey90", linewidth = 0.3)
)
ggsave(
here("years", "2025", "42", "output", "mean_annual_temp_changes.png"),
plot = plot_temp_change,
width = 10,
height = 6,
dpi = 300
)
plot_temp_change