2013-10-09 60 views
1

我想缩小带形图中的x轴,使其不会超出我的数据。我怎样才能做到这一点?在R条形图中缩短x轴

我用at = seq(1, length.out = length(unique(Avagno0 $NugentScore)), by = 0.5)带来colmuns之间的间隔更靠近在一起。 这是图的画面:

enter image description here

任何帮助,不胜感激!

回答

0

您需要使用par设置外边缘,如果你想有一个更窄的绘图窗口。

narrow.at <- seq(1,length.out=length(unique(OrchardSprays $treatment)), by=0.5) 
par(oma=c(1,1,1,5)) 
stripchart(decrease ~ treatment, 
    main = "stripchart(OrchardSprays)", 
    vertical = TRUE, log = "y", at=narrow.at, data = OrchardSprays, 
    xlim=c(0.5,max(narrow.at)+.5))