Follow

R course at uni was not very good at grabbing my attention so I did a simple eclipse as a demo for how to start doing art in R:

library(tidyverse)

theme_void() %+replace% theme(
legend.position="none",
panel.background = element_rect(fill="black")
) -> th

n <- 200000

tibble(
dr = rnorm(n = n, sd=0.06, mean = 0) %>% abs,
al = rnorm(n = n, sd = 1.0, mean = 0)
) %>% mutate(
r = 1 + dr,
x = r * cos(al),
y = r * sin(al)
) %>% ggplot(aes(x=x, y=y)) +
geom_point(alpha = 0.2, shape = ".", color = "white") +
coord_equal() +
xlim(-3, 3) +
ylim(-2, 2) +
th

· Edited · · Web · 0  · 16  · 41