Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(tidyverse)
- library(ggforce)
- library(patchwork)
- library(ggthemes)
- df <- tibble(
- t = seq(0,2*pi,length.out=61)
- ) %>% mutate(idx=row_number(),
- m = sqrt((idx%%2)+0.1),
- x = m*cos(t),
- y = m*sin(t))
- df %>%
- filter(idx<nrow(df)) %>%
- ggplot(aes(x=x,y=y,group=idx%%3)) +
- geom_bspline_closed(radius=unit(2,"mm"), aes(fill=idx%%3), n=20) +
- geom_bspline_closed(expand=unit(2,"mm"), aes(fill=idx%%3), n=20) +
- coord_fixed() +
- theme_void() +
- scale_fill_viridis_c(alpha=0.3, end=0.8, option="magma", guide="none")
- df %>%
- filter(idx<nrow(df)) %>%
- ggplot(aes(x=x,y=y)) +
- geom_bspline_closed(radius=unit(2,"mm"), n=1000, alpha=0.2) +
- geom_bspline_closed(expand=unit(-2,"mm"), n=1000, alpha=0.8) +
- coord_fixed() +
- theme_void() +
- scale_fill_viridis_c(alpha=0.3, end=0.8, option="magma", guide="none") +
- geom_point(size=0.5) +
- geom_path(size=0.2) +
- geom_shape(size=0.3, expand=unit(-2,"mm"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement