-
Notifications
You must be signed in to change notification settings - Fork 16
/
logo.R
48 lines (42 loc) · 1.36 KB
/
logo.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## load ggplot2
library(ggplot2)
## drawing
cap1 <- data.frame(
x = c(-.45, 0, .45, 0),
y = c( .50, .65, .50, .35) - .225
)
cap2 <- data.frame(
x = c(-.28, -.28, .28, .28),
y = c(.525, .30, .30, .525) - .225
)
strng <- data.frame(
x = c(.00, .36, .36, .345, .33, .33, 0),
y = c(.51, .475, .27, .28, .26, .46, .49) - .225
)
btn <- data.frame(
x = c(-.045, 0, .045, 0),
y = c(.50, .53, .50, .47) - .225
)
## background/border
h1 <- hexagon::hexdf(1)
h2 <- hexagon::hexdf(.975)
h1$x <- round(h1$x, 2)
h2$x <- round(h2$x, 2)
## create figures
dir.create("man/figures")
## create and save hex sticker
ggplot(h1, aes(x, y)) +
geom_polygon(fill = "#000000", size = 1, colour = "#000000") +
geom_polygon(data = h2, fill = "#006677", size = 0) +
geom_polygon(data = cap2, fill = "#222222", size = .5, colour = "#000000") +
geom_polygon(data = cap1, fill = "#444444", size = .5, colour = "#000000") +
geom_polygon(data = strng, fill = "goldenrod", size = 0) +
geom_polygon(data = btn, fill = "#000000", size = 0) +
annotate("text", 0, -.175, label = "tidyversity", size = 6,
colour = "#ffffff", family = "Consolas") +
hexagon::theme_hexagon() +
theme(plot.margin = margin(-6, -6, -9, -8, unit = "pt")) +
ggsave("man/figures/logo.png", width = 1.74, height = 2, units = "in",
bg = "transparent")
## ignore in build
usethis::use_build_ignore("logo.R")