Skip to content

Commit

Permalink
variant with white shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
bydata committed Dec 1, 2024
1 parent ba5364e commit fb49177
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions R/24-only-circular-shapes.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Binary file added plots/24-only-circular-shapes-shadows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fb49177

Please sign in to comment.