base R的图可以放在函数里,然后再用cowplot或者patchwork拼图。不确定可不可以用在gemtc包上。
像这样:
library(ggplot2)
# p1 is created using base R, p2 is created with ggplot2
p1 <- function() plot(x = 1:100, y = log(1:100))
p2 <- ggplot(data = data.frame(x = 1:100, y = c(1:100)^2), aes(x = x, y = y)) +
geom_point()
# combining p1 & p2.
p <- cowplot::plot_grid(p1, p2)
# print p
p