3
我有8個地塊,我想繪製所有的一頁。每個圖是使用基本圖形制作的,我寧願堅持使用,而不是使用lattice
或ggplot
。如何調整佈局在R的行的寬度
下面的方案是一個頁面,其中每個數字表示哪個繪圖#佔據該頁面的比例。有沒有辦法與layout
或任何其他基本功能做到這一點?
1111122
3333444
5556666
7788888
一些代碼,我到目前爲止有:
pdf("test.pdf",height=30,width=10)
widths = c(5/7,2/7,4/7,3/7,3/7,4/7,2/7 5/7) # this doesn't work
x=layout(matrix(1:8,nrow=4,ncol=2,byrow=T), widths=widths,
heights=rep(1/4,4))
for (ix in 1:4){
plot(rnorm(100))
plot(rnorm(100))
}
dev.off()