change the background color of grid.arrange output

后端 未结 2 1689
野性不改
野性不改 2021-01-14 08:44

I am using grid.arrange from gridExtra package to put two graphs on one page and save it to a png file. I like to change the background colour of t

2条回答
  •  轮回少年
    2021-01-14 09:03

    Try setting the bg = argument to png()

    library(gridExtra)
    library(lattice)
    
    png(bg = "wheat1")
        grid.arrange(xyplot(1:10~1:10, pch=16), xyplot(1:4~1:4, pch=16))
    dev.off()
    

    enter image description here

提交回复
热议问题