knitr::include_graphics('plots/day19_dcc_22.gif')
19 de abril de 2022
plot_fill <- function(anio){
cli::cli_process_start("year {.val {anio}}")
p <- latim |>
filter(year == anio) |>
ggplot() +
aes(long, lat, group = paste(country, group), fill = pover) +
geom_polygon(color = "gray90", size = .23) +
coord_fixed() +
scale_fill_gradientn(colors = t2(2)) +
labs(
title = glue::glue("Latinoamérica - Pobreza extrema", "\n{anio}")
, caption = "#30DayChartChallenge | Day 19: Global Change\nData: OWID | @JhonKevinFlore1"
, fill = "%"
) +
guides(
fill = guide_colorbar(
direction = "horizontal"
, title.position = "top"
, title.hjust = .5
, label.hjust = .5
, label.position = "bottom"
, keywidth = .2
, keyheight = .2
)
) +
theme_void() +
# hrbrthemes::theme_ft_rc(grid = FALSE, axis_text_size = 0) +
theme(
legend.position = c(.3, .35)
, legend.text = element_text()
, plot.title = element_text(hjus = .5, face = "bold")
, plot.subtitle = element_text( hjust = .5)
, plot.caption = element_text(hjust = 1, vjust = .5)
, plot.caption.position = 'panel'
)
plot(p)
cli::cli_process_done()
}