如何更改facet_wrap标题'颜色?

时间:2016-11-26 08:40:06

标签: r ggplot2

df<-data.frame(c(1:5,11:15),c(1:10),c(1,1,1,1,1,2,1,2,1,2),c(rep('o',5),rep('m',5)))
colnames(df)<-c('a','b','c','d')
qplot(a,b,data=df,geom = 'point',color=factor(df$c))+facet_wrap(~d)+scale_colour_manual(values=c("blue","orange"))+theme(panel.background = element_rect(fill='white', colour='black'))

使用上面的代码,方面标题&#39;背景是灰色的。如何将其改为白色以适应整个情节?

1 个答案:

答案 0 :(得分:0)

我用+theme(panel.background=element_rect(fill='white', colour='black'),strip.background=element_rect(fill='white', colour='white'))

解决了这个问题