Created
January 20, 2019 07:43
-
-
Save chichacha/09e9b4fc5e4a5106ec4d4c440dd4713a to your computer and use it in GitHub Desktop.
Connected Dots Patterns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
my_grid <- tibble( | |
x = c(1:30), | |
y = c(1:30) | |
) %>% expand.grid() | |
my_grid <- my_grid %>% | |
mutate(x_noise = rnorm(nrow(my_grid), mean=0, sd=0.1), | |
y_noise = rnorm(nrow(my_grid), mean=0, sd=0.1), | |
hue = runif(nrow(my_grid),min=0, max=2*pi), | |
angle_45 = sample(seq(0,2*pi,by=pi/4),size=nrow(my_grid),replace=T), | |
radius = ifelse(angle_45 %in% c(0,pi/2,pi,pi+(pi/2),2*pi),1,sqrt(2))) | |
my_grid %>% | |
ggplot(aes(x=x,y=y)) + | |
geom_point(size=10,shape=21, stroke=1, fill="#000000ae", color="#000000") + | |
geom_point(aes(x,y=y), size=4, color="#ffffffde") + | |
geom_spoke(aes(angle=angle_45,radius=radius), | |
color="#ffffffde", size=1.5, lineend="round") + | |
theme_void() + | |
coord_fixed() | |
ggsave("grid_pattern.png", width=9, height=9, dpi=200) |
Author
chichacha
commented
Jan 20, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment