我有以下情节:

通过执行获得:
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 ~ . )
Run Code Online (Sandbox Code Playgroud)
我该如何摆脱后面出现灰色背景的100和200.
我希望它是白色的,而不会改变我目前正在使用的其他主题.
谷歌搜索后,我发现这篇文章,解释了可以应用的不同操作facet.
事实证明,我的问题可以通过以下方式解决:
theme(legend.key = element_blank(), strip.background = element_rect(colour="red", fill="#CCCCFF") )
Run Code Online (Sandbox Code Playgroud)
使用strip.background = element_rect(colour="red", fill="#CCCCFF")内部theme()做的工作.