2016-11-26 89 views
0
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標題的顏色?

+1

你試過'theme(strip.background = ...)'嗎? – mt1022

+1

或者'+ theme_bw()'? –

回答

0

我解決了這個問題+theme(panel.background=element_rect(fill='white', colour='black'),strip.background=element_rect(fill='white', colour='white'))