如何更改facet_wrap标题的颜色?
问题描述:
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'))
随着上面的代码,facet标题的背景是灰色的。如何将它变成白色以适应整个情节?如何更改facet_wrap标题的颜色?
答
我解决了这个问题+theme(panel.background=element_rect(fill='white', colour='black'),strip.background=element_rect(fill='white', colour='white'))
你试过'theme(strip.background = ...)'吗? – mt1022
或者'+ theme_bw()'? –