Displaying multiple 3d plots in the same window using plot3D {rasterVis} in R -


i interested in making 2 3d topographic plots display side side in same xquartz device window. displaying 2 3d plots in same window straightforward using rgl package - there plenty of examples in documentation using mfrow3d() , other methods.

however, need use plot3d() function rastervis package. reason using plot3d() rastervis, rather surface3d() rgl, need use "drape" argument in plot3d() display values raster colors on 3d topographic map (and raster has different values 1 creates z axis on plot). if has tips on analogous drape within rgl function, interested in that!

when try use mfrow3d() along plot3d() function, brings series of blank device windows instead of displaying 2 plots side side in same window.

here code make topographic map using plot3d, rastervis documentation:

    data(volcano)     r <- raster(volcano)     extent(r) <- c(0, 610, 0, 870)     levelplot(r, col.regions=terrain.colors)     plot3d(r) 

and here try use mfrow3d plot 2 identical volcano plots side side, 1 in blue , 1 in red, adapted rgl documentation:

    volcanos <- list(r, r)     col <- c("blue", "red")     open3d()     mfrow3d(1,2)     (i in 1:2) {     next3d()        plot3d(volcanos[[i]], col=col[i])     } 

is trying possible plot3d rastervis? ideas appreciated!

the current version of rastervis::plot3d opens new device each call. have modified code test if there active device, , open new 1 if needed. commit example works expected. should install development version of rastervis devtools::install_github('oscarperpinan/rastervis').


Comments