forked from MelinaKlostermann/Molitor-et-al-2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme_paper.R
52 lines (37 loc) · 1.58 KB
/
theme_paper.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
theme_paper <- function(){
font <- "Arial" #assign font family up front
theme_classic2() %+replace% #replace elements we want to change
theme(
text = element_text(colour = "black"
),
#grid elements
panel.grid.major = element_blank(), #strip major gridlines
panel.grid.minor = element_blank(), #strip minor gridlines #strip axis ticks
plot.background = element_blank(),
#panel.border=element_rect(color="black", fill = NA),
panel.background = element_blank(),
#axis lines
axis.line = element_line(colour = 'black', size = 0.5),
axis.ticks = element_line(colour = "black", size = 0.5),
#text elements
axis.title = element_text( #axis titles
#family = font, #font family
size = 8,
color = "black"), #font size
axis.text = element_text( #axis text
#family = font, #axis famuly
size = 7,
color = "black"), #font size
axis.text.x = element_text( #margin for axis text
margin=margin(5, b = 10),
color = "black"),
legend.text = element_text( #axis text
#family = font, #axis famuly
size = 7,
color = "black"),
legend.title = element_blank(),
legend.background = element_blank()
#since the legend often requires manual tweaking
#based on plot content, don't define it here
)
}