1
我试图在R中生成直方图,但某些x标签丢失。 这里是我写的代码:(x值应该是-3.5,-2.5,-1.5,-0.5,0.5,1.5,2.5,3.5,并在这些值定心杆)R直方图缺失负x标签
> tmp <- hist(x, breaks=-3.5:(max(x)+1), xaxt="n", right=FALSE, xlab="log(MRS)",main="Pairwise Family-Health")
> axis(1, at=tmp$mids, labels=-3.5:max(x))
有谁知道这个问题可能是什么?谢谢!
R不会将标签打印在彼此之上,现在没有足够的空间来打印所有标签。让你的阴谋更广泛,所以有更多的空间。 – MrFlick
相关的qs [here](http://stackoverflow.com/questions/28416992/names-on-the-x-axis-of-barplot-in-r)和[here](http://stackoverflow.com/问题/ 16596772/questions-about-axes-and-mtext)[here](http://stackoverflow.com/questions/12899086/changing-plot-label-sizes-in-r-cex-is-not-working) – rawr