2
我使用gplots包來輸出條形圖。我用它一個for循環中,所以代碼的其餘部分被省略,以使其更清晰:R:gplots,barlot:如何修正獨立於紙張設置的條寬?
library("gplots")
pdf(file = "/Users/Tim/desktop/pgax.pdf", onefile = TRUE, paper = "special")
par(mfrow = c(4,2)) #figures arranged in 2 rows and 2 columns
par(las=2) #perpendicular labels on x-axis
barplot2(expression,ylab = expression(expression),main = graph.header, cex.names =0.85, beside = TRUE, offset = 0, xpd = FALSE,axis.lty = 0, cex.axis = 0.85, plot.ci = TRUE,ci.l = expression - sd.value, ci.u = expression + sd.value, col = colors,width = 1,names.arg = c(etc))
現在,當我指定在A4的紙張大小,並在兩列打印出杆由讓他們填滿指定的全部空間。如果每條草地上只有幾根條,那麼寬度與高度相比就太大了。我知道我應該使用xlimit and width
=甚至可以是縱橫比?,但我無法得到我想要的結果。不方便的方式是指定紙張的高度和寬度輸出,並手動調整每次重複繪製條紋的數量。但這似乎並不合適。有人知道一個方便的方法來修復我的地塊中的寬度條?
所有幫助非常感謝!