@@ -85,11 +85,13 @@ theme_grey <- function(base_size = 11, base_family = "") {
85
85
axis.ticks = element_line(colour = " grey20" ),
86
86
axis.ticks.length = unit(half_line / 2 , " pt" ),
87
87
axis.title.x = element_text(
88
- margin = margin(t = 0.8 * half_line , b = 0.8 * half_line / 2 )
88
+ margin = margin(t = half_line ),
89
+ vjust = 1
89
90
),
90
91
axis.title.y = element_text(
91
92
angle = 90 ,
92
- margin = margin(r = 0.8 * half_line , l = 0.8 * half_line / 2 )
93
+ margin = margin(r = half_line ),
94
+ vjust = 1 ,
93
95
),
94
96
95
97
legend.background = element_rect(colour = NA ),
@@ -126,17 +128,17 @@ theme_grey <- function(base_size = 11, base_family = "") {
126
128
plot.background = element_rect(colour = " white" ),
127
129
plot.title = element_text(
128
130
size = rel(1.2 ),
129
- hjust = 0 ,
131
+ hjust = 0 , vjust = 1 ,
130
132
margin = margin(b = half_line * 1.2 )
131
133
),
132
134
plot.subtitle = element_text(
133
135
size = rel(0.9 ),
134
- hjust = 0 ,
136
+ hjust = 0 , vjust = 1 ,
135
137
margin = margin(b = half_line * 0.9 )
136
138
),
137
139
plot.caption = element_text(
138
140
size = rel(0.9 ),
139
- hjust = 1 ,
141
+ hjust = 1 , vjust = 1 ,
140
142
margin = margin(t = half_line * 0.9 )
141
143
),
142
144
plot.margin = margin(half_line , half_line , half_line , half_line ),
@@ -179,12 +181,12 @@ theme_linedraw <- function(base_size = 11, base_family = "") {
179
181
axis.ticks = element_line(colour = " black" , size = 0.25 ),
180
182
# NB: match the *visual* thickness of axis ticks to the panel border
181
183
# 0.5 clipped looks like 0.25
182
-
184
+
183
185
# pure black panel border and grid lines, but thinner
184
186
panel.border = element_rect(fill = NA , colour = " black" , size = 0.5 ),
185
187
panel.grid.major = element_line(colour = " black" , size = 0.05 ),
186
188
panel.grid.minor = element_line(colour = " black" , size = 0.025 ),
187
-
189
+
188
190
# strips with black background and white text
189
191
strip.background = element_rect(fill = " black" ),
190
192
strip.text = element_text(colour = " white" , size = rel(0.8 ))
@@ -210,7 +212,7 @@ theme_light <- function(base_size = 11, base_family = "") {
210
212
211
213
# match legend key to panel.background
212
214
legend.key = element_rect(fill = " white" , colour = NA ),
213
-
215
+
214
216
# dark strips with light text (inverse contrast compared to theme_grey)
215
217
strip.background = element_rect(fill = " grey70" , colour = NA ),
216
218
strip.text = element_text(colour = " white" , size = rel(0.8 ))
@@ -233,7 +235,7 @@ theme_dark <- function(base_size = 11, base_family = "") {
233
235
234
236
# match axes ticks thickness to gridlines
235
237
axis.ticks = element_line(colour = " grey20" , size = 0.25 ),
236
-
238
+
237
239
# match legend key to panel.background
238
240
legend.key = element_rect(fill = " grey50" , colour = NA ),
239
241
0 commit comments