Closed courtiol closed 7 years ago
Try something inspired by that (from Deepayan Sarkar deepayan.sarkar@r-project.org ):
library(grid) library(lattice)
p <- levelplot(volcano) pargs <- trellis.panelArgs(p, 1) lims <- do.call(prepanel.default.levelplot, pargs) str(lims) # viewport scales
grid.newpage() pushViewport(viewport(xscale = extendrange(lims$xlim, f = 0.07), yscale = extendrange(lims$ylim, f = 0.07))) do.call(panel.levelplot, pargs)
Another way using the package mapmate looks very promising (but potentially slow): https://www.r-bloggers.com/spinning-globes-with-r/
We need to try that too!
I looked at how one could make nice 3D geospheres in R using rgl. The following site does not tell the details but the results are stunning, so I really want to add this possibility in the package at some point :-)
link1 link2
It is not that difficult once one has the png of the entire map, I am struggling however to extract the central part of the lattice plots (i.e. the map itself, without the axes, keys, margins...). I want the area selected by trellis.focus()...
Once this will be solved, then the following works: