library(ggplot2)
set.seed(0310)
packed_circles <- packer(
n = 50, big_r = 5, med_r = 3, small_r = 1,
min_x = 0, max_x = 100, min_y = 0, max_y = 100
)
packed_circles
packed_circles |>
ggplot(aes(x, y, group = group)) +
theme_void() +
theme(plot.background = element_rect(fill = "black")) +
geom_polygon(fill = "white", color = "red") +
coord_equal()
Run the code above in your browser using DataLab