我想知道如何在保持pdf文件每一页尺寸不变的情况下,使图的高度和宽度相同(以便形成正方形)。
library(gridExtra)
library(ggplot2)
pl <- lapply(1:20, function(.x) qplot(1:10, rnorm(10),
main=paste("plot", .x))+
labs(x="", y="", title=""))
lay <- rbind(c(1,2,3),
c(4,5,6),
c(7,8,9))
ml <- marrangeGrob(pl, nrow=3, ncol=2, layout_matrix=lay, left="left",
bottom="bottom")
ggsave("file.pdf", ml, height = 297 , width = 210,
units = c("mm"),limitsize = FALSE)