我有以下简化的用例。基本上我有一些GGPLOT2情节,我想与其他正在使用的基本图形库产生的结合plot.new()
等:如何通过arrangeGrob获取基本图形plot.new以与其他人结合?
p1 <- generate_ggplot1(...)
p2 <- generate_ggplot2(...)
p3 <- generate_ggplot3(...)
# how to get hold of the plot output and make it available as
# p4 for arrangeGrob?
plot.new()
...
final <- gridExtra::arrangeGrob(p1, p2, p3, p4, layout_matrix = rbind(c(1,2), c(3,4)), widths=c(7,7), heights=c(7,7))
ggplot2::ggsave(filename=output.file,plot=final,width=14,height=14)
哪些选项有做到这一点?从此改写P4分别是原生ggplot2
我不知道是否有可能与'gridextra',但检查'gridbase'; [在R数字窗口中结合base和ggplot图形](https://stackoverflow.com/questions/14124373/combine-base-and-ggplot-graphics-in-r-figure-window/14125565#14125565),[生成的图表通过'plot'和'ggplot'并排](https://stackoverflow.com/questions/13021863/plots-generated-by-plot-and-ggplot-side-by-side) – Henrik