2015-11-06 88 views
0

我在想是否可以使用ggplot2改变剧情的背景颜色?像白色或其他东西?而不是在以下如何设置绘图空白的背景颜色?

enter image description here

+2

http://stackoverflow.com/questions/6736378/how-do-i-change-the-background-color-of-a-plot-made-with-ggplot2 我认为这是一个重复的问题 –

+0

尝试添加'+ theme_bw()'它比讨厌的灰色好得多。对于更多的内建主题,只需进入编辑器,编写'主题'并将其自动完成 – jenesaisquoi

回答

0

颜色来改变面板的背景颜色,使用下面的代码:

myplot + theme(panel.background = element_rect(fill = 'green', colour = 'red')) 

要改变绘图的颜色(但小组没有色彩),你可以这样做:

myplot + theme(plot.background = element_rect(fill = 'green', colour = 'red')) 

在这里看到更多的细节主题https://groups.google.com/forum/#!topic/ggplot2/AfTB5ijyUIE