Is it possible to create an image like this one by using R?
The image is taken from UseR! 2019 Spatial workshop part I.
Is it possible to create an image like this one by using R?
The image is taken from UseR! 2019 Spatial workshop part I.
using rgl
and pals
for colours:
> library(rgl)
> library(pals)
make some data
> m = matrix(runif(54),6,9)
cut into 10 categories and lookup colour in a palette of 10 colours:
> col = pals::viridis(10)[cut(m, 10)]
start the engines...
> open3d()
glX
5
plot as many as you like at different Z coordinates, starting at zero:
> surface3d(1:9, 1:6, rep(0,length(col)), color = col, back = "lines", smooth=FALSE)
> surface3d(1:9, 1:6, rep(1,length(col)), color = col, back = "lines", smooth=FALSE)
> surface3d(1:9, 1:6, rep(2,length(col)), color = col, back = "lines", smooth=FALSE)
> surface3d(1:9, 1:6, rep(3,length(col)), color = col, back = "lines", smooth=FALSE)
Here is a modern solution: https://www.urbandemographics.org/post/figures-map-layers-r/
Unfortunately it is not a package, but still very easy to use.
Also, there is a CRAN package too: https://marcosci.github.io/layer/