YQ.Wang
YQ.Wang

Reputation: 1177

How to change facet_wrap titles' colours?

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'))

With the code above, the facet titles' backgrounds are grey. How to change it into white in order to fit the whole plot?

Upvotes: 1

Views: 1352

Answers (1)

YQ.Wang
YQ.Wang

Reputation: 1177

I solved this with +theme(panel.background=element_rect(fill='white', colour='black'),strip.background=element_rect(fill='white', colour='white'))

Upvotes: 1

Related Questions