Search code examples
rggplot2ggally

ggpairs fill histograms with white


I would like to get the histograms or bar line in the following plot in white. It's mainly for ink saving concerns.

library(GGally)
library(ggplot2)
data(tips, package = "reshape")
pm <- ggpairs(tips[,1:3])

I've tried

pm + theme(panel.background = element_rect(fill = "white"),
plot.background = element_rect(fill = "white"),rect= element_rect(fill="white"))

but couldn't reach the histogram fill.

Any help?


Solution

  • This should do what you want:

    ggpairs(tips[,1:3], params = c(fill = "white", color = "black")) + 
      theme_bw()
    

    enter image description here