SL.UEM.1524.ZS |>
filter(iso2c %in% c("ES", "PT", "GR")) |>
left_join(iso2c, by = "iso2c") |>
year_to_enddate() |>
mutate(value = value/100) |>
add_flag_color("Iso2c") |>
ggplot() + theme_minimal() +
geom_line(aes(x = date, y = value, color = color)) +
xlab("") + ylab("Unemp., youth total (% of total labor force 15-24)") +
scale_color_identity() + add_flags +
theme(legend.title = element_blank(),
legend.position = c(0.25, 0.9),
legend.direction = "horizontal") +
scale_x_date(breaks = seq(1900, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
geom_rect(data = data_frame(start = as.Date("2011-01-01"),
end = as.Date("2014-01-01")),
aes(xmin = start, xmax = end, ymin = -Inf, ymax = +Inf),
fill = viridis(4)[4], alpha = 0.2) +
geom_vline(xintercept = as.Date("2011-01-01"), linetype = "dashed", color = viridis(3)[3]) +
geom_vline(xintercept = as.Date("2014-01-01"), linetype = "dashed", color = viridis(3)[3]) +
scale_y_continuous(breaks = 0.01*seq(-100, 10000, 5),
labels = percent_format(a = 1)) +
geom_hline(yintercept = 0, linetype = "dashed", color = "black")