Questions tagged «r-grid»

4
如何获得ggplots的“不平衡”网格?
通过使用以下命令,grid.arrange我可以ggplot在网格中排列多个图形以实现多面板图形: library(ggplot2) library(grid) library(gridExtra) 生成一些ggplot2图,然后 plot5 <- grid.arrange(plot4, plot1, heights=c(3/4, 1/4), ncol=1, nrow=2) 如何获得“不平衡”的2列布局,整个第一个列中有一个图,第二个列中有三个图?我通过尝试用grid.arrange一个网格(例如plot5上面的图)相对于另一个图绘制一个“网格”方法,但获得了: 排列错误(...,as.table = as.table,clip = clip,main = main,:输入必须是grobs! 更新: 谢谢你的建议。我将调查viewports和grid。同时,感谢@​​ DWin,layOut'wq'包中的函数对于我Sweave文档中的编译图非常有效: 更新2: 该arrangeGrob命令(由@baptiste建议)也可以很好地工作,并且看起来非常直观-至少很容易更改两列的宽度。它还具有不需要`wq'软件包的好处。 例如,这是我的Sweave文件中的代码: <<label=fig5plot, echo=F, results=hide>>= plot5<-grid.arrange(plot4, arrangeGrob(plot1, plot2, plot3, ncol=1), ncol=2, widths=c(1,1.2)) @ \begin{figure}[] \begin{center} <<label=fig5,fig=TRUE,echo=T, width=10,height=12>>= <<fig5plot>> @ \end{center} \caption{Combined plots using the `arrangeGrob' …
94 r  ggplot2  r-grid 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.