# Ridgeline: Temperatur-Verteilung pro Dekade
p1 <- ggplot(temp_dat, aes(x = t, y = decade, fill = after_stat(x))) +
geom_density_ridges_gradient(
scale = 2.2, rel_min_height = 0.01,
quantile_lines = TRUE, quantiles = 2
) +
scale_fill_gradientn(
colours = rev(RColorBrewer::brewer.pal(11, "RdYlGn")), guide = "none"
) +
labs(
title = "Wien wird wärmer",
subtitle = "Tagesmittel-Temperaturen je Dekade, Hohe Warte 1960–2024",
x = "°C", y = NULL
) +
theme_minimal(base_size = 10) +
theme(plot.title = element_text(face = "bold", size = 13))
# Raincloud: Wahlbeteiligung pro Bundesland (mit "Regen" = Einzelgemeinden)
p2 <- ggplot(wahl_dat, aes(x = wahlbeteiligung, y = bundesland,
fill = bundesland)) +
stat_halfeye(
adjust = 0.6, width = 0.7, .width = c(0.5, 0.95),
justification = -0.15, point_colour = NA, alpha = 0.85
) +
geom_boxplot(width = 0.18, outlier.shape = NA, alpha = 0.6,
colour = "grey20") +
geom_point(position = position_nudge(y = -0.22),
size = 0.7, alpha = 0.3, colour = "grey25") +
scale_fill_brewer(palette = "Spectral", guide = "none") +
scale_x_continuous(labels = function(x) paste0(x, " %")) +
labs(
title = "Wo wurde 2024 stärker gewählt?",
subtitle = "Wahlbeteiligung pro Gemeinde, NRW 2024 – jeder Punkt = eine Gemeinde",
x = NULL, y = NULL
) +
theme_minimal(base_size = 11) +
theme(plot.title = element_text(face = "bold", size = 13),
panel.grid.major.y = element_blank())
# Dumbbell: Lebenserwartung EU 2010 → 2023
p3 <- ggplot() +
geom_segment(
data = le$wide,
aes(x = y2010, xend = y2023, y = land, yend = land, colour = delta),
linewidth = 1.6, lineend = "round"
) +
geom_point(data = filter(le$long, year == 2010),
aes(x = le, y = land), colour = "#D4A843", size = 2.4) +
geom_point(data = filter(le$long, year == 2023),
aes(x = le, y = land), colour = "#1B365D", size = 2.4) +
scale_colour_gradient(low = "#E5E7EB", high = "#1B365D",
name = "Δ (J.)") +
labs(
title = "Lebenserwartung in der EU",
subtitle = "2010 → 2023, sortiert nach Zugewinn",
x = "Jahre", y = NULL
) +
theme_minimal(base_size = 10) +
theme(plot.title = element_text(face = "bold", size = 13),
legend.position = "right",
legend.key.height = unit(0.8, "lines"),
legend.key.width = unit(0.4, "lines"),
panel.grid.major.y = element_blank())
# Bump: Top-Vornamen Wien
endpoints <- namen_dat |>
group_by(geschlecht) |>
filter(jahr == max(jahr)) |>
ungroup()
bump_palette <- colorRampPalette(
RColorBrewer::brewer.pal(8, "Set2")
)(n_distinct(namen_dat$name))
navy <- "#1B365D"
gold_hell <- "#E9C46A"
p4 <- ggplot(namen_dat, aes(x = jahr, y = rang, colour = name)) +
geom_bump(linewidth = 1.4, smooth = 8, alpha = 0.9) +
geom_point(size = 2.6) +
geom_text(data = endpoints, aes(label = name),
hjust = 0, nudge_x = 0.2, size = 3.2, fontface = "bold",
colour = gold_hell) +
facet_wrap(~ geschlecht, ncol = 2) +
scale_y_reverse(breaks = 1:8) +
scale_x_continuous(breaks = c(2014, 2018, 2022),
limits = c(2014, 2025.5)) +
scale_colour_manual(values = bump_palette) +
guides(colour = "none") +
labs(
title = "Rangwechsel der Top-Vornamen in Wien",
subtitle = "Top 8, 2014–2023",
x = NULL, y = "Rang"
) +
theme_minimal(base_size = 10) +
theme(plot.background = element_rect(fill = navy, colour = NA),
panel.background = element_rect(fill = navy, colour = NA),
plot.title = element_text(face = "bold", size = 13,
colour = gold_hell),
plot.subtitle = element_text(colour = "grey80"),
strip.text = element_text(face = "bold", colour = gold_hell),
axis.title = element_text(colour = gold_hell),
axis.text = element_text(colour = "grey85"),
panel.grid.minor = element_blank(),
panel.grid.major.x = element_blank(),
panel.grid.major.y = element_line(colour = "grey30"))
# Layout: oben Ridgeline + Dumbbell nebeneinander,
# darunter Raincloud + Bump je über die volle Breite
((p1 + p3) / p2 / p4) +
plot_layout(heights = c(1, 1.4, 1.1)) +
plot_annotation(
title = "Vier moderne Chart-Typen jenseits von Box & Balken",
subtitle = "Ridgeline · Dumbbell · Raincloud · Bump",
theme = theme(
plot.title = element_text(face = "bold", size = 15,
colour = "#1B365D"),
plot.subtitle = element_text(colour = "grey40", margin = margin(b = 8))
)
)