@@ -472,7 +472,7 @@ theme_minimal <- function(base_size = 11, base_family = "",
472
472
panel.background = element_blank(),
473
473
panel.border = element_blank(),
474
474
strip.background = element_blank(),
475
- plot.background = element_blank( ),
475
+ plot.background = element_rect( fill = paper , colour = NA ),
476
476
477
477
complete = TRUE
478
478
)
@@ -553,7 +553,7 @@ theme_void <- function(base_size = 11, base_family = "",
553
553
header_family = NULL ,
554
554
base_line_size = base_size / 22 ,
555
555
base_rect_size = base_size / 22 ,
556
- ink = " black" , paper = " white " ) {
556
+ ink = " black" , paper = alpha( ink , 0 ) ) {
557
557
half_line <- base_size / 2
558
558
559
559
# Only keep indispensable text: legend and plot titles
@@ -621,6 +621,13 @@ theme_void <- function(base_size = 11, base_family = "",
621
621
plot.tag.position = ' topleft' ,
622
622
623
623
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
+ )
624
631
)
625
632
626
633
# make sure all elements are set to NULL if not explicitly defined
0 commit comments