我很难使用 rasterVis 和 gridExtra 在 R 中一起绘制地图。这就是我的代码的样子(对不起,它肯定不优雅):
require(rasterVis)
require(gridExtra)
p1 <- levelplot(avit_bac12, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = RdBuTheme, main=NULL, scales=list(draw=FALSE))
p2 <- levelplot(avit_bac17, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = RdBuTheme, main=NULL, scales=list(draw=FALSE))
p3 <- levelplot(avit_eng, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = RdBuTheme, main=NULL, scales=list(draw=FALSE))
p4 <- levelplot(avit_sf, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = RdBuTheme, main=NULL, scales=list(draw=FALSE))
p5 <- levelplot(bac12_bac17, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = RdBuTheme, main=NULL, scales=list(draw=FALSE))
p6 <- levelplot(bac12_eng, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = RdBuTheme, main=NULL, scales=list(draw=FALSE))
p7 <- levelplot(bac12_sf, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = RdBuTheme, main=NULL, scales=list(draw=FALSE))
p8 <- levelplot(bac17_eng, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = RdBuTheme, main=NULL, scales=list(draw=FALSE))
p9 <- levelplot(bac17_sf, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = RdBuTheme, main=NULL, scales=list(draw=FALSE))
p10 <- levelplot(eng_sf, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = RdBuTheme, main=NULL, scales=list(draw=FALSE))
p.avit <- levelplot(avit, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = magmaTheme, main="Avitabile et al. (2016)", scales=list(draw=FALSE))
p.bac12 <- levelplot(bac12, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = magmaTheme, main="Baccini et al. (2012)", scales=list(draw=FALSE))
p.bac17 <- levelplot(bac17, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = magmaTheme, main="Baccini et al. (2017)", scales=list(draw=FALSE))
p.eng <- levelplot(eng, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = magmaTheme, main="Englund et al. (2017)", scales=list(draw=FALSE))
p.sf <- levelplot(sf, margin=FALSE, xlab=NULL, ylab=NULL, par.settings = magmaTheme, main="Soares-Filho et al. (2017)", scales=list(draw=FALSE))
p.list <- list(p.avit, p.bac12, p.bac17, p.eng, p.sf,
p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)
lay <- rbind(c(NA, 2, 3, 4, 5),
c(1, 6, 7, 8, 9),
c(2, NA, 10, 11, 12),
c(3, NA, NA, 13, 14),
c(4, NA, NA, NA, 15))
grid.arrange(grobs=p.list, layout_matrix=lay,
vp = grid::viewport(width=0.4,height=0.3))
关于如何解决这个问题的任何想法?