gpt4 book ai didi

r - 更改轴标签的颜色

转载 作者:行者123 更新时间:2023-12-03 13:54:01 25 4
gpt4 key购买 nike

这是相关的代码:

ggplot.3plus<-ggplot(summary.3plus, aes(x=sp1, y=fract.mean, fill=ForestAge)) + 
geom_bar(position=position_dodge())+ coord_cartesian(ylim = c(1, 1.175))+
geom_errorbar(aes(ymin=fract.mean-se, ymax=fract.mean+se),
width=.2, # Width of the error bars
position=position_dodge(.9))

ggplot.3plus<- ggplot.3plus + theme(axis.title.x = element_text(colour = "red"))

可以看到,通过最后一行代码,我可以更改轴标题的颜色,但不能更改轴 LABELS 的颜色。

最佳答案

关于什么

ggplot.3plus + theme(axis.text.x=element_text(colour="red"))

ggplot2 wiki page了解更多主题详情。

关于r - 更改轴标签的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12568032/

25 4 0