如何在小节线上绘制X轴?

时间:2019-01-29 16:48:44

标签: r

我试图在r中制作最简单的条形图,但无法显示x轴。我并不想添加标签或其他任何花哨的内容,我只是想要一个 有黑线。

我尝试了“ axis.lty=1”,“ xaxt”,“ lty”和“ axes.lty”,但都没有帮助。我在做什么错了?

plantmeans<-c(802,1273,468,1286)
barplot(plantmeans,xlab = "Treatment", ylab = "Time taken to unfurl/secs",axis.lty=1)

1 个答案:

答案 0 :(得分:1)

尝试一下:

plot1<-barplot(plantmeans,xlab = "Treatment", ylab = "Time taken to unfurl/secs",axis.lty=4)
axis(1,at=plot1,labels=plantmeans)