forked from mrdwab/koboloadeR
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathkobo_unhcr_style_map.R
78 lines (73 loc) · 3.08 KB
/
kobo_unhcr_style_map.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
72
73
74
75
76
77
78
#' @name kobo_unhcr_style_map
#' @rdname kobo_unhcr_style_map
#' @title UNHCR ggplot2 theme
#'
#' @description Return ggplot2 styling for maps
#'
#' @return Return UNHCR Style
#'
#' @author Edouard Legoupil -
#'
#' @examples
#' \dontrun{
#' kobo_unhcr_style_map()
#' }
#'
#' @export kobo_unhcr_style_map
#'
kobo_unhcr_style_map <- function() {
font <- "Lato"
ggplot2::theme_minimal() +
ggplot2::theme(
#------------
## Plot
# plot.background = element_rect(fill = "transparent",colour = NA),
# plot.background = element_rect(fill = "#f5f5f2", color = NA),
plot.title = ggplot2::element_text(family = font,
face = "bold",
size = 12,
hjust = 0,
color = "#4e4d47"),
plot.subtitle = ggplot2::element_text(family = font,
size = 8,
hjust = 0,
color = "#4e4d47",
margin = ggplot2::margin(b = -0.1, t = -0.1, l = 2, unit = "cm"),
debug = F),
plot.caption = ggplot2::element_text(family = font,
size = 6,
hjust = 0.92,
margin = ggplot2::margin(t = 0.2, b = 0, unit = "cm"),
color = "#939184"),
plot.margin = unit(c(.5,.5,.2,.5), "cm"),
#------------
## Panel
panel.border = element_blank(),
# panel.grid.minor = element_line(color = "#ebebe5", size = 0.2),
panel.grid.major = element_line(color = "#ebebe5", size = 0.2),
panel.grid.minor = element_blank(),
# panel.background = element_rect(fill = "#f5f5f2", color = NA),
# panel.spacing = unit(c(-.1,0.7,.2,1.7), "cm"),
panel.spacing = unit(c(-.1,0.2,.2,0.2), "cm"),
#------------
## legend
legend.title = element_text(size = 8),
legend.text = element_text(size = 7, hjust = 0, color = "#4e4d47"),
legend.text.align = 0,
#legend.position = "bottom",
legend.position = c(0.5, 0.03),
legend.box = "horizontal",
# legend.position = c(0.8, 0.03),
#legend.background = element_rect(fill = "transparent",colour = NA),
# legend.background = element_rect(fill = "#f5f5f2", color = NA),
legend.background = element_rect(fill = alpha('white', 0.0), color = NA),
#------------
## Axis
axis.line = element_blank(),
axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank()
)
}