I have the following plot:
obtained by executing:
ggplot() +
stat_summary( data = test_data1, aes(x=x, y=(1-value) , colour = as.factor(1) , lty = as.factor(1) ) , fun.y=mean, geom="line" , size=1 ) +
stat_summary( data = test_data1, aes(x=x, y=(1-value) , colour = as.factor(1), shape=as.factor(1) ) , fun.y=mean, geom="point" , size=3, pch=21, fill="white" ) +
stat_summary( data = test_data2, aes(x=x, y=(1-value) , colour = as.factor(2), lty = as.factor(2) ) , fun.y=mean, geom="line", size=1 ) +
stat_summary( data = test_data2, aes(x=x, y=(1-value) , colour = as.factor(2), shape=as.factor(2)) , fun.y=mean, geom="point", size=3, pch=21, fill="white" ) +
theme_bw(base_size = 14, base_family = "Palatino") +
theme(legend.key = element_blank() ) +
expand_limits(x=c(0), y=c(0)) +
facet_grid(distance ~ . )
How do I get rid of the grey background appearing behind 100
and 200
.
I would like that to be white, without changing the rest of the theme I am using at the moment.
After googling a bit more I found this post, which explains different manipulations that can be applied to facet
.
In turns out my question can be solved by doing:
theme(legend.key = element_blank(), strip.background = element_rect(colour="red", fill="#CCCCFF") )
Using strip.background = element_rect(colour="red", fill="#CCCCFF")
inside theme()
does the work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With