diff --git a/R/24-only-circular-shapes.R b/R/24-only-circular-shapes.R index 2b84305..91d62a1 100644 --- a/R/24-only-circular-shapes.R +++ b/R/24-only-circular-shapes.R @@ -20,10 +20,7 @@ world_dorling <- cartogram_dorling(world, weight = "area", k = 3) bg_gradient_fill <- grid::linearGradient(c("#12142b", "#282c69")) bubble_gradient_fill <- grid::radialGradient(c("#282c6911", "#282c6966")) -p <- ggplot(world_dorling) + - geom_sf( - fill = bubble_gradient_fill, color = "grey79" - ) + +p_base <- ggplot(world_dorling) + labs( title = "A World of Bubbles", caption = "**Note:** Each bubble represents a country. The size of the bubble @@ -39,4 +36,20 @@ p <- ggplot(world_dorling) + plot.caption = element_markdown(size = 6, hjust = 0.5), plot.margin = margin(rep(4, 4)) ) + +p_base + + geom_sf( + fill = bubble_gradient_fill, color = "grey79" + ) ggsave(file.path("plots", "24-only-circular-shapes.png"), width = 6, height = 4.06) + + +bubble_gradient_fill <- grid::radialGradient(c("#1F214F", "#202453")) +p <- p_base + + ggfx::with_shadow( + geom_sf( + fill = bubble_gradient_fill, color = "grey79" + ), + colour = "white", x_offset = 2.5, y_offset = 2.5 + ) +ggsave(file.path("plots", "24-only-circular-shapes-shadows.png"), width = 6, height = 4.06) diff --git a/plots/24-only-circular-shapes-shadows.png b/plots/24-only-circular-shapes-shadows.png new file mode 100644 index 0000000..2111c79 Binary files /dev/null and b/plots/24-only-circular-shapes-shadows.png differ