随着grid.arrange我可以安排多个ggplot在网格中人物使用类似,实现了多屏图:
library(ggplot2)
library(grid)
library(gridExtra)
Run Code Online (Sandbox Code Playgroud)
然后生成一些ggplot2图
plot5 <- grid.arrange(plot4, plot1, heights=c(3/4, 1/4), ncol=1, nrow=2)
Run Code Online (Sandbox Code Playgroud)
如何获得"不平衡"2 col布局,其中第一个col中有一个绘图,第二个col中有三个绘图?我玩弄了一个'网格网格'方法,试图用grid.arrange一个网格(例如plot5,上面)绘制另一个图,但得到了:
在ArrangeGrob中出错(...,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' command.}
\label{fig:five}
\end{figure}
Run Code Online (Sandbox Code Playgroud)
产生以下输出:

顺便说一下,有人告诉我为什么出现'> NA'?
我经常有刻面的数值.我希望提供足够的信息来解释补充标题中的这些分面值,类似于轴标题.贴标签选项重复了许多不必要的文本,并且对于较长的变量标题不可用.
有什么建议?
默认值:
test<-data.frame(x=1:20, y=21:40, facet.a=rep(c(1,2),10), facet.b=rep(c(1,2), each=20))
qplot(data=test, x=x, y=y, facets=facet.b~facet.a)
Run Code Online (Sandbox Code Playgroud)

我想要的是:

我能在ggplot中做得最好:
qplot(data=test, x=x, y=y)+facet_grid(facet.b~facet.a, labeller=label_both)
Run Code Online (Sandbox Code Playgroud)

如@Hendy所示,类似于: 在ggplot2图中添加辅助y轴 - 使其完美