library(tidyverse)
library(ggvoronoi)
library(deldir)
Blue Vorontex #47.2
Non-polar Circular Vorontex
Generative aRt
R
Same concept as my Blue Vorentex #47 - just with ggvoronoi instead of polar cooridnates.
Generate random points, making sure that we can reproduce them.
set.seed(47)
<- 100
tiler <- rnorm(tiler)
x <- rnorm(tiler) y
Then, calculate the tiles, and collect them in a dataframe:
<- data.frame(x=x, y=y) %>%
points rowid_to_column("id") %>%
mutate(id = as.integer(id))
Next, plot it, and add a circle for a cutout - thats the outline in geom_voronoi:
<- seq(0, 2 * pi, length.out = 3000)
s <- 2
radius <- 0
c_x <- 0
c_y <- data.frame(x = radius * (c_x + cos(s)),
circle y = radius * (c_y + sin(s)),
group = rep(1, 3000))
%>%
points ggplot(aes(x = x, y = y, fill = factor(id))) +
geom_voronoi(outline = circle, color = 1, size= 0.1) +
theme_minimal() +
theme(legend.position = "none" ,
axis.text = element_blank(),
axis.title = element_blank(),
axis.line = element_blank(),
axis.ticks = element_blank(),
panel.grid = element_blank()) +
scale_fill_manual(values = hcl.colors(100, "Blues 2")) +
theme(legend.position = "none") +
coord_fixed()
ggsave("Blue_Vorontex-47.2.png")