@@ -559,7 +559,10 @@ theme_void <- function(base_size = 11, base_family = "",
559
559
# Only keep indispensable text: legend and plot titles
560
560
t <- theme(
561
561
line = element_blank(),
562
- rect = element_blank(),
562
+ rect = element_rect(
563
+ fill = paper , colour = NA , linewidth = 0 , linetype = 1 ,
564
+ inherit.blank = FALSE
565
+ ),
563
566
polygon = element_blank(),
564
567
point = element_blank(),
565
568
text = element_text(
@@ -591,12 +594,18 @@ theme_void <- function(base_size = 11, base_family = "",
591
594
legend.box.margin = rel(0 ),
592
595
legend.box.spacing = unit(0.2 , " cm" ),
593
596
legend.ticks.length = rel(0.2 ),
597
+ legend.background = element_blank(),
598
+ legend.frame = element_blank(),
599
+ legend.box.background = element_blank(),
594
600
strip.clip = " on" ,
595
601
strip.text = element_text(size = rel(0.8 )),
596
602
strip.switch.pad.grid = rel(0.5 ),
597
603
strip.switch.pad.wrap = rel(0.5 ),
604
+ strip.background = element_blank(),
598
605
panel.ontop = FALSE ,
599
606
panel.spacing = NULL ,
607
+ panel.background = element_blank(),
608
+ panel.border = element_blank(),
600
609
plot.margin = rel(0 ),
601
610
plot.title = element_text(
602
611
size = rel(1.2 ),
@@ -619,15 +628,9 @@ theme_void <- function(base_size = 11, base_family = "",
619
628
hjust = 0.5 , vjust = 0.5
620
629
),
621
630
plot.tag.position = ' topleft' ,
631
+ plot.background = element_rect(),
622
632
623
633
complete = TRUE
624
- ) + theme(
625
- # Contrary to default behaviour, we do not want to inherit the plot
626
- # background from a blank root element
627
- plot.background = element_rect(
628
- fill = paper , colour = NA , linewidth = 0 , linetype = 1 ,
629
- inherit.blank = FALSE
630
- )
631
634
)
632
635
633
636
# make sure all elements are set to NULL if not explicitly defined
0 commit comments