我的代码:
x <- c(10, 50, 20, 40)
barplot(x, names.arg=LETTERS[1:4])
我想要的是:
我在 R 和 Adobe Acrobat 的帮助下制作了这个图。我想知道我能否使用纯 R 代码获得此图?
最佳答案
您可以使用 mtext
添加文本
mtext("E", side = 1, line = 3, adj = 0.375)
mtext("F", side = 1, line = 3, adj = 0.875)
然后用lines
画线,但指示xpd=T
lines(c(0,3.5),c(-10,-10),xpd=TRUE)
lines(c(3.8,4.8),c(-10,-10),xpd=TRUE)
关于r - R : add horizontal lines below the plot region 中的条形图标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34016393/