@@ -133,6 +133,8 @@ theme_grey <- function(base_size = 11, base_family = "",
133
133
lineheight = 0.9 , hjust = 0.5 , vjust = 0.5 , angle = 0 ,
134
134
margin = margin(), debug = FALSE
135
135
),
136
+ spacing = unit(half_line , " pt" ),
137
+ margins = margin(half_line , half_line , half_line , half_line ),
136
138
137
139
axis.line = element_blank(),
138
140
axis.line.x = NULL ,
@@ -145,7 +147,7 @@ theme_grey <- function(base_size = 11, base_family = "",
145
147
axis.text.r = element_text(margin = margin(l = 0.8 * half_line / 2 , r = 0.8 * half_line / 2 ),
146
148
hjust = 0.5 ),
147
149
axis.ticks = element_line(colour = " grey20" ),
148
- axis.ticks.length = unit( half_line / 2 , " pt " ),
150
+ axis.ticks.length = rel( 0.5 ),
149
151
axis.ticks.length.x = NULL ,
150
152
axis.ticks.length.x.top = NULL ,
151
153
axis.ticks.length.x.bottom = NULL ,
@@ -173,31 +175,31 @@ theme_grey <- function(base_size = 11, base_family = "",
173
175
),
174
176
175
177
legend.background = element_rect(colour = NA ),
176
- legend.spacing = unit( 2 * half_line , " pt " ),
178
+ legend.spacing = rel( 2 ),
177
179
legend.spacing.x = NULL ,
178
180
legend.spacing.y = NULL ,
179
- legend.margin = margin( half_line , half_line , half_line , half_line ) ,
181
+ legend.margin = NULL ,
180
182
legend.key = NULL ,
181
183
legend.key.size = unit(1.2 , " lines" ),
182
184
legend.key.height = NULL ,
183
185
legend.key.width = NULL ,
184
- legend.key.spacing = unit( half_line , " pt " ) ,
186
+ legend.key.spacing = NULL ,
185
187
legend.text = element_text(size = rel(0.8 )),
186
188
legend.title = element_text(hjust = 0 ),
187
189
legend.ticks.length = rel(0.2 ),
188
190
legend.position = " right" ,
189
191
legend.direction = NULL ,
190
192
legend.justification = " center" ,
191
193
legend.box = NULL ,
192
- legend.box.margin = margin( 0 , 0 , 0 , 0 , " cm " ),
194
+ legend.box.margin = rel( 0 ),
193
195
legend.box.background = element_blank(),
194
- legend.box.spacing = unit( 2 * half_line , " pt " ),
196
+ legend.box.spacing = rel( 2 ),
195
197
196
198
panel.background = element_rect(fill = " grey92" , colour = NA ),
197
199
panel.border = element_blank(),
198
200
panel.grid = element_line(colour = " white" ),
199
201
panel.grid.minor = element_line(linewidth = rel(0.5 )),
200
- panel.spacing = unit( half_line , " pt " ) ,
202
+ panel.spacing = NULL ,
201
203
panel.spacing.x = NULL ,
202
204
panel.spacing.y = NULL ,
203
205
panel.ontop = FALSE ,
@@ -240,7 +242,7 @@ theme_grey <- function(base_size = 11, base_family = "",
240
242
hjust = 0.5 , vjust = 0.5
241
243
),
242
244
plot.tag.position = ' topleft' ,
243
- plot.margin = margin( half_line , half_line , half_line , half_line ) ,
245
+ plot.margin = NULL ,
244
246
245
247
complete = TRUE
246
248
)
@@ -466,30 +468,35 @@ theme_void <- function(base_size = 11, base_family = "",
466
468
lineheight = 0.9 , hjust = 0.5 , vjust = 0.5 , angle = 0 ,
467
469
margin = margin(), debug = FALSE
468
470
),
471
+ spacing = unit(half_line , " pt" ),
472
+ margins = margin(half_line , half_line , half_line , half_line ),
469
473
axis.text = element_blank(),
470
474
axis.title = element_blank(),
471
- axis.ticks.length = unit( 0 , " pt " ),
475
+ axis.ticks.length = rel( 0 ),
472
476
axis.ticks.length.x = NULL ,
473
477
axis.ticks.length.x.top = NULL ,
474
478
axis.ticks.length.x.bottom = NULL ,
475
479
axis.ticks.length.y = NULL ,
476
480
axis.ticks.length.y.left = NULL ,
477
481
axis.ticks.length.y.right = NULL ,
478
- axis.minor.ticks.length = unit( 0 , " pt " ) ,
482
+ axis.minor.ticks.length = NULL ,
479
483
legend.box = NULL ,
480
484
legend.key.size = unit(1.2 , " lines" ),
481
485
legend.position = " right" ,
482
486
legend.text = element_text(size = rel(0.8 )),
483
487
legend.title = element_text(hjust = 0 ),
484
- legend.key.spacing = unit(half_line , " pt" ),
488
+ legend.key.spacing = rel(1 ),
489
+ legend.margin = rel(0 ),
490
+ legend.box.margin = rel(0 ),
491
+ legend.box.spacing = unit(0.2 , " cm" ),
485
492
legend.ticks.length = rel(0.2 ),
486
493
strip.clip = " inherit" ,
487
494
strip.text = element_text(size = rel(0.8 )),
488
- strip.switch.pad.grid = unit( half_line / 2 , " pt " ),
489
- strip.switch.pad.wrap = unit( half_line / 2 , " pt " ),
495
+ strip.switch.pad.grid = rel( 0.5 ),
496
+ strip.switch.pad.wrap = rel( 0.5 ),
490
497
panel.ontop = FALSE ,
491
- panel.spacing = unit( half_line , " pt " ) ,
492
- plot.margin = unit(c( 0 , 0 , 0 , 0 ), " lines " ),
498
+ panel.spacing = NULL ,
499
+ plot.margin = rel( 0 ),
493
500
plot.title = element_text(
494
501
size = rel(1.2 ),
495
502
hjust = 0 , vjust = 1 ,
@@ -542,6 +549,8 @@ theme_test <- function(base_size = 11, base_family = "",
542
549
lineheight = 0.9 , hjust = 0.5 , vjust = 0.5 , angle = 0 ,
543
550
margin = margin(), debug = FALSE
544
551
),
552
+ spacing = unit(half_line , " pt" ),
553
+ margins = margin(half_line , half_line , half_line , half_line ),
545
554
546
555
axis.line = element_blank(),
547
556
axis.line.x = NULL ,
@@ -552,7 +561,7 @@ theme_test <- function(base_size = 11, base_family = "",
552
561
axis.text.y = element_text(margin = margin(r = 0.8 * half_line / 2 ), hjust = 1 ),
553
562
axis.text.y.right = element_text(margin = margin(l = 0.8 * half_line / 2 ), hjust = 0 ),
554
563
axis.ticks = element_line(colour = " grey20" ),
555
- axis.ticks.length = unit( half_line / 2 , " pt " ),
564
+ axis.ticks.length = rel( 0.5 ),
556
565
axis.ticks.length.x = NULL ,
557
566
axis.ticks.length.x.top = NULL ,
558
567
axis.ticks.length.x.bottom = NULL ,
@@ -580,15 +589,15 @@ theme_test <- function(base_size = 11, base_family = "",
580
589
),
581
590
582
591
legend.background = element_rect(colour = NA ),
583
- legend.spacing = unit( 2 * half_line , " pt " ),
592
+ legend.spacing = rel( 2 ),
584
593
legend.spacing.x = NULL ,
585
594
legend.spacing.y = NULL ,
586
595
legend.margin = margin(0 , 0 , 0 , 0 , " cm" ),
587
596
legend.key = NULL ,
588
597
legend.key.size = unit(1.2 , " lines" ),
589
598
legend.key.height = NULL ,
590
599
legend.key.width = NULL ,
591
- legend.key.spacing = unit( half_line , " pt " ) ,
600
+ legend.key.spacing = NULL ,
592
601
legend.key.spacing.x = NULL ,
593
602
legend.key.spacing.y = NULL ,
594
603
legend.text = element_text(size = rel(0.8 )),
@@ -600,13 +609,13 @@ theme_test <- function(base_size = 11, base_family = "",
600
609
legend.box = NULL ,
601
610
legend.box.margin = margin(0 , 0 , 0 , 0 , " cm" ),
602
611
legend.box.background = element_blank(),
603
- legend.box.spacing = unit( 2 * half_line , " pt " ),
612
+ legend.box.spacing = rel( 2 ),
604
613
605
614
panel.background = element_rect(fill = " white" , colour = NA ),
606
615
panel.border = element_rect(fill = NA , colour = " grey20" ),
607
616
panel.grid.major = element_blank(),
608
617
panel.grid.minor = element_blank(),
609
- panel.spacing = unit( half_line , " pt " ) ,
618
+ panel.spacing = NULL ,
610
619
panel.spacing.x = NULL ,
611
620
panel.spacing.y = NULL ,
612
621
panel.ontop = FALSE ,
@@ -624,8 +633,8 @@ theme_test <- function(base_size = 11, base_family = "",
624
633
strip.placement = " inside" ,
625
634
strip.placement.x = NULL ,
626
635
strip.placement.y = NULL ,
627
- strip.switch.pad.grid = unit( half_line / 2 , " pt " ),
628
- strip.switch.pad.wrap = unit( half_line / 2 , " pt " ),
636
+ strip.switch.pad.grid = rel( 0.5 ),
637
+ strip.switch.pad.wrap = rel( 0.5 ),
629
638
630
639
plot.background = element_rect(colour = " white" ),
631
640
plot.title = element_text(
@@ -649,7 +658,7 @@ theme_test <- function(base_size = 11, base_family = "",
649
658
hjust = 0.5 , vjust = 0.5
650
659
),
651
660
plot.tag.position = ' topleft' ,
652
- plot.margin = margin( half_line , half_line , half_line , half_line ) ,
661
+ plot.margin = NULL ,
653
662
654
663
complete = TRUE
655
664
)
0 commit comments