-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout.r
72 lines (63 loc) · 2.5 KB
/
layout.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
INCH.PER.CM <- 1/2.54
TEXTWIDTH <- 18.13275*INCH.PER.CM
COLWIDTH <- 8.85553*INCH.PER.CM
HEIGHT <- 23.61475*INCH.PER.CM
BASE.SIZE <- 8.5
SMALL.SIZE <- 7
SYM.SIZE <- 1.2 ## Symol size in legends
LINE.SIZE <- 1
POINT.SIZE <- 0.5
BIG.POINT.SIZE <- 0.8
COLOURS.LIST <- c("black", "#E69F00", "#999999", "#009371", "#ed665a", "#1f78b4", "#009371", "#beaed4")
OUTDIR_TIKZ <- "plots/img-tikz/"
OUTDIR_PDF <- "plots/img-pdf/"
theme_paper_base <- function() {
return(theme_bw(base_size=BASE.SIZE) +
theme(axis.title.x = element_text(size = BASE.SIZE),
axis.title.y = element_text(size = BASE.SIZE),
legend.title = element_text(size = BASE.SIZE),
legend.position = "top",
plot.margin = unit(c(0,0,0,0.1), 'cm')))
}
theme_paper_base_no_shrink <- function() {
return(theme_bw(base_size=BASE.SIZE) +
theme(axis.title.x = element_text(size = BASE.SIZE),
axis.title.y = element_text(size = BASE.SIZE),
legend.title = element_text(size = BASE.SIZE),
legend.position = "top",
plot.margin = unit(c(0,0.05,0,0.1), 'cm')))
}
theme_paper_legend_right <- function() {
return(theme_bw(base_size=BASE.SIZE) +
theme(axis.title.x = element_text(size = BASE.SIZE),
axis.title.y = element_text(size = BASE.SIZE),
legend.title = element_text(size = BASE.SIZE),
legend.position = "right",
plot.margin = unit(c(0,0,0,0.1), 'cm')))
}
theme_paper_no_legend <- function() {
return(theme_bw(base_size=BASE.SIZE) +
theme(axis.title.x = element_text(size = BASE.SIZE),
axis.title.y = element_text(size = BASE.SIZE),
legend.position = "none",
plot.margin = unit(c(0,0,0,0.1), 'cm')))
}
theme_paper_no_legend_small <- function() {
return(theme_bw(base_size=SMALL.SIZE) +
theme(axis.title.x = element_text(size = SMALL.SIZE),
axis.title.y = element_text(size = SMALL.SIZE),
legend.position = "none",
plot.margin = unit(c(0,0,0,0.1), 'cm')))
}
shrink_legend <- function(boxc=-5) {
return(theme(legend.margin=margin(0,0,0,0),
legend.box.margin=margin(boxc,boxc,boxc,boxc)))
}
create_save_locations <- function() {
if (!dir.exists(OUTDIR_PDF)) {
dir.create(OUTDIR_PDF, recursive = TRUE)
}
if (!dir.exists(OUTDIR_TIKZ)) {
dir.create(OUTDIR_TIKZ, recursive = TRUE)
}
}