我认为合适的方法是使用
pos=
添加时的参数
?axis
到您现有的
barplot
bp <- barplot(...)
wp_means <- c(-0.3, -0.2, -0.34, -0.39, -0.275, -0.275, -0.283)
cols<-c("blue1", "cyan","chartreuse","mediumspringgreen","maroon1","orange","red")
wp <-data.frame(a=c(wp_means),b=c(12,15,3,6,9,"Control","DL"))
wp$c=factor(wp$b, levels = c("Control",15,"DL",12,9,6,3))
wp <- wp[order(wp$c), ]
bp <- barplot(height=wp$a, names.arg=wp$c, col=cols, las=1, xaxt="n",
ylab = "Water potential (MPA)",
pch=21, bg="black", cex=0.7, cex.lab=0.8, font.lab=2,
cex.axis=0.7, font.axis=2, cex.main=1, ylim=c(-0.5,0), xaxt="n")
axis(side=3, pos=0, at=bp, labels=levels(wp$c))
title(main="Water Potential", line=3)
line=3
添加时
title()