![]() If NULL, uses the plot.background fill value from the plot theme. Ggsave() offers a dedicated argument bg to set theīackground colour. Legend.key = element_rect(fill = "transparent") Legend.background = element_rect(fill = "transparent"), Plot.background = element_rect(fill = "transparent",Ĭolour = NA_character_), # necessary to avoid drawing plot outline = element_blank(), # get rid of minor grid = element_blank(), # get rid of major grid Panel.background = element_rect(fill = "transparent",Ĭolour = NA_character_), # necessary to avoid drawing panel outline The fastest way to modify the plot above to have a completely transparent background is to set theme()'s rect argument, as all the rectangle elements inherit from rect: p <- p + theme(rect = element_rect(fill = "transparent"))Ī more controlled way is to set theme()'s more specific arguments individually: p <- p + theme( Create the initial plot: library(ggplot2)įill = "transparent" # for the inside of the boxplot
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |