Skip to content

Instantly share code, notes, and snippets.

@chichacha
Created August 11, 2019 05:43
Show Gist options
  • Save chichacha/1c8f869f68911e4dec53eeefa3a69dfb to your computer and use it in GitHub Desktop.
Save chichacha/1c8f869f68911e4dec53eeefa3a69dfb to your computer and use it in GitHub Desktop.
Drawing Logo for CD
library(tidyverse)
library(ggforce)
my_points <- tibble(
x = c(1,4,4,0,0,4,4,1,1,2.5,0,0,0,2.5,1,0),
y = c(0,0,2,2,5,5,7,7,0,0,5,2,2,7,7,5),
g = c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)
)
my_points2 <- my_points %>%
add_row(
x = c(2.5,5,6,2.5,2.5,6,5,2.5,2.5,3.5,3.5,2.5,5,6,6,5),
y = c(0,0,2,2,5,5,7,7,0,0,7,7,0,2,5,7),
g = c(5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8)
)
my_points2 %>%
ggplot(aes(x=x,y=y,group=g, fill=factor(g))) +
geom_shape(alpha=0.8,
aes(fill=factor(g))) +
theme_void() +
coord_fixed(ratio=0.7) +
geom_mark_hull(color=NA, radius=unit(3,"mm"), alpha=0.1) +
scale_fill_grey(guide="none", start=0.1, end=0.4) +
geom_point(shape=21, size=5, fill="#ffffffde",color="#ffffff00") +
geom_delaunay_segment(size=0.2, color="#ffffff", linetype=3, aes(group=NULL)) +
theme(panel.background=element_rect(fill="#ffffff"))
ggsave("~/Downloads/CD_Logo.png",width=8,height=6)
@chichacha
Copy link
Author

CD_Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment