i'm quite desperate trying to adjust two levelplots of one rasterstack each on one plot. It seems like rasterVis::levelplot
does not take the par(mfrow = c(...))
option for splitting the pane. An example using two rasterstacks that shall be arranged side by side on a new plot window :
f <- system.file("external/test.grd", package="raster")
r1 <- stack(raster(f),log(raster(f)))
r2 <- stack(raster(f)-500,raster(f)+500)
par(mfrow=c(2,2))
levelplot(r1)
levelplot(r2)
Here, levelplot(r1)
is being plotted on the full scale window, while levelplot(r2)
unfortunately is painting over levelplot(r1)
.
I tried to play around, wrapping the call for levelplot
with the print
function, which takes split
as well as newpage = false
options. Unfortunately I do not get the twist on how to use split
properly so I end up with nothing but frustration.
I'd really appreciate your help, thanks in advance
Andi
print(p1, split=c(1,1,1,2), more=TRUE); print(p2, split=c(1,2,1,2))
– Interiorsplit=
argument in?print.trellis
. – Headwaterprint(p, split=c(col(m)[i], row(m)[i], 2, 2)
should probably readprint(p, split=c(col(m)[i], row(m)[i], ncol(m), nrow(m))
. – Familiar