I'm having difficulties creating a multiplot using the levelplot
function with margins.
I face at least one of these issues with every attempt: too much white space, error, or too large a margin.
library(raster)
library(rasterVis)
library(gridExtra)
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
x <- levelplot(r, margin=T)
# ATTEMPT 1
print(x, split = c(1, 1, 2, 2), more = TRUE)
print(x, split = c(2, 1, 2, 2), more = TRUE)
print(x, split = c(1, 1, 1, 2), more = FALSE)
# ATTEMPT 2 - error
l <- rasterVis::levelplot(raster::stack(list(x, x, x)), layout=c(3,1), margin = T); l
# ATTEMPT 3 = best, but a lot of white space and bigger margin
grobs <- arrangeGrob(grobs=list(x, x, x), ncol=3)
grid.arrange(grobs)
i'm wanting something like this: (bonus if with commom legend)
ty !