我使用以下命令创建了下面的图表:
ggplot(long.data, aes(owner,value)) + stat_summary(fun.y=mean,geom="bar",
fill=c("deepskyblue","deepskyblue4")) +
stat_summary(fun.data=mean_cl_normal,geom="errorbar",position=
position_dodge(width=.90),width=.1) +
labs(x="",y="") + facet_grid(IV~experiment+type,scales="free_y") +
theme(strip.text.y = element_text(colour = 'red4'))
如果我只想更改上部x轴(在此示例中为“Implicit”和“Explicit”级别)的文本颜色(可能还包括背景颜色),该怎么做?这是否可能?我在ggplot2文档中没有读到相关内容。
编辑:对于混淆造成的困惑,我想更改上部条形中的文本和背景颜色,而不是facet的颜色。
![plot](https://istack.dev59.com/VwyjG.webp)
strip.text.x=element_text(color="red")
,而不是针对正文/对象标签。 - this.is.not.a.nick