-
Notifications
You must be signed in to change notification settings - Fork 2
/
theme_DECC.R
58 lines (48 loc) · 3.1 KB
/
theme_DECC.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
48
49
50
51
52
53
54
55
## Nice default formats:
## Graph border is 1pt
DECC.linewidth <- (1/72.27)*25.4 # 1pt linewidth
DECC.grey <- "grey60" # Grey for axes
DECC.darkgrey <- "black" # Grey for axis labels
DECC.colours <- list(cyan = "#009EE3",
orange = "#C75200",
red = "#AA0721",
green = "#797900",
purple = "#742F89",
blue = "#0066A1")
theme_DECC <- function(base_size = 10, base_family = "Helvetica") {
structure(list(
axis.line = theme_blank(),
axis.text.x = theme_text(family = base_family, size = base_size, colour = DECC.grey, vjust = 1),
axis.text.y = theme_text(family = base_family, size = base_size, colour = DECC.grey, hjust = 1),
axis.ticks = theme_segment(size = DECC.linewidth, colour = DECC.grey),
axis.title.x = theme_text(family = base_family, size = base_size, colour = DECC.darkgrey, vjust = 0),
axis.title.y = theme_text(family = base_family, size = base_size, colour = DECC.darkgrey, angle = 90, hjust = 0.5, vjust = 0.3),
axis.ticks.length = unit(1.5, "mm"),
axis.ticks.margin = unit(1.5, "mm"),
panel.background = theme_blank(),
panel.border = theme_rect(size = 2*DECC.linewidth, colour = DECC.grey), # The linewidth appears to be half of what is asked for.
panel.grid.major = theme_blank(),
panel.grid.minor = theme_blank(),
panel.margin = unit(0.25, "lines"),
strip.background = theme_rect(fill = "grey80", colour = NA),
strip.text.x = theme_text(family = base_family, size = base_size * 0.8),
strip.text.y = theme_text(family = base_family, size = base_size * 0.8, angle = -90),
plot.background = theme_rect(colour = NA, fill = NA),
plot.title = theme_text(family = base_family, size = base_size * 1.2),
plot.margin = unit(c(1, 1, 0.5, 0.5), "lines"),
legend.background = theme_rect(colour="white"),
legend.margin = unit(0.2, "cm"),
legend.key = theme_rect(fill = "grey95", colour = "white"),
legend.key.size = unit(1.2, "lines"),
legend.key.height = NULL,
legend.key.width = NULL,
legend.text = theme_text(family = base_family, size = base_size * 0.8),
legend.text.align = NULL,
legend.title = theme_text(family = base_family, size = base_size * 0.8, face = "bold", hjust = 0),
legend.title.align = NULL,
legend.position = "right",
legend.direction = NULL,
legend.justification = "center",
legend.box = NULL
), class = "options")
}