我正在尝试生成条形图,但 y 轴刻度太短。这是我的代码:
barplot(as.matrix(dat), log="y", ylim=c(10000,100000000), beside=TRUE,
ylab = "Number of reads", col = c("gray","black","white"))
它为轴留下了空间(按照 ylim),但不填充实际轴。我已经经历过?barplot
并尝试了一些事情(通过谷歌搜索我认为xpd = F, yaxs = c(10000,10000000,5)
应该有效,但没有)。
我知道这是一件小事,但这正是我多年来一直困扰的问题,而不是实际工作,所以任何帮助将不胜感激!
编辑:
为输入的家伙干杯!
I did initially plot without ylim, but it ends up with an even more bizarre axis (with the same problem); I actually picked my ylim values to give it a nicer spaced axis.
这是数据:
dat <- read.table(text="D2,D3n,D3m,D4n,D4m
21234722,34262282,31920464,25486357,20712943
35343,64403,22537,39934,46547
126646,312286,101105,81537,76944", header=TRUE, sep=",")
编辑2:
@DWin 说得对 - 我更新了我的 R,现在它绘制得很好 - 谢谢大家!