@@ -472,7 +472,7 @@ theme_minimal <- function(base_size = 11, base_family = "",
472472 panel.background = element_blank(),
473473 panel.border = element_blank(),
474474 strip.background = element_blank(),
475- plot.background = element_blank( ),
475+ plot.background = element_rect( fill = paper , colour = NA ),
476476
477477 complete = TRUE
478478 )
@@ -517,13 +517,16 @@ theme_void <- function(base_size = 11, base_family = "",
517517 header_family = NULL ,
518518 base_line_size = base_size / 22 ,
519519 base_rect_size = base_size / 22 ,
520- ink = " black" , paper = " white " ) {
520+ ink = " black" , paper = alpha( ink , 0 ) ) {
521521 half_line <- base_size / 2
522522
523523 # Only keep indispensable text: legend and plot titles
524524 t <- theme(
525525 line = element_blank(),
526- rect = element_blank(),
526+ rect = element_rect(
527+ fill = paper , colour = NA , linewidth = 0 , linetype = 1 ,
528+ inherit.blank = FALSE
529+ ),
527530 polygon = element_blank(),
528531 point = element_blank(),
529532 text = element_text(
@@ -555,12 +558,18 @@ theme_void <- function(base_size = 11, base_family = "",
555558 legend.box.margin = rel(0 ),
556559 legend.box.spacing = unit(0.2 , " cm" ),
557560 legend.ticks.length = rel(0.2 ),
561+ legend.background = element_blank(),
562+ legend.frame = element_blank(),
563+ legend.box.background = element_blank(),
558564 strip.clip = " on" ,
559565 strip.text = element_text(size = rel(0.8 )),
560566 strip.switch.pad.grid = rel(0.5 ),
561567 strip.switch.pad.wrap = rel(0.5 ),
568+ strip.background = element_blank(),
562569 panel.ontop = FALSE ,
563570 panel.spacing = NULL ,
571+ panel.background = element_blank(),
572+ panel.border = element_blank(),
564573 plot.margin = rel(0 ),
565574 plot.title = element_text(
566575 size = rel(1.2 ),
@@ -583,6 +592,7 @@ theme_void <- function(base_size = 11, base_family = "",
583592 hjust = 0.5 , vjust = 0.5
584593 ),
585594 plot.tag.position = ' topleft' ,
595+ plot.background = element_rect(),
586596
587597 complete = TRUE
588598 )
0 commit comments