在图上添加新的刻度标签名称

问题描述

我已使用以下脚本将因子级别的缩写名称更改为全称:

Est.labs <- c("Ocean_Bal","CLR","GGR","HKR","HUR","MLR","PST","RMR","SHR","Ocean_Yam")
names(Est.labs)<- c ("Ballina inshore","Clarence River","Georges River","Hawkesbury River","Hunter River","Macleay River","Port Stephens","Richmond River","Shoalhaven River","Yamba inshore")

我现在想将这些新名称添加到下面的图中,即+labels=names(Est.labs),但是不确定它属于哪个位置,因为通常在scale_x_discrete部分中;但是,这已经在脚本中了:

p2<-p1 +
  scale_fill_manual(values = c("northern" = "firebrick4","Central" = "dodgerblue4","Southern" = "darkseagreen4"))+ scale_x_discrete(limits = positions)+ theme(legend.position = "none") +
  geom_errorbar(aes(ymin=data_long$Concentration-se_long$se,ymax=data_long$Concentration+se_long$se),width=.2,position=position_dodge(.9))+ylab("Concentration (µmol/mol)")

这可能很简单,但是我尝试任何其他事情都没有运气...任何建议将不胜感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)