Last chance! 50% off unlimited learning
Sale ends in
surface3d
in the rgl packageplot3D(x, background=0, maxpixels=100000, zfac=6, drape=NULL, col=terrain.colors, rev=TRUE, ...)
x
a RasterLayer object
background
value used to replace NA values
maxpixels
Maximum number of pixels to use
zfac
Numeric, to set the elevation scale relative to x and y
drape
RasterLayer, to 'drape' colors representing the values of this layer on the 3D representation of layer x
. In this casex
typically has elevation data
col
A color palette, i.e. a vector of n contiguous colors such as rainbow
, heat.colors
, and topo.colors
, on one or your own making
rev
Logical. If TRUE
, the color palette values are reversed in order
...
Any argument that can be passed to plot3d
}if (require(rgl)) {
r <- raster(system.file("external/test.grd", package="raster"))
plot3D(r)
}
Run the code above in your browser using DataLab