2013-10-09 175 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))