if (FALSE) {
data(LIDAR)
mba.int <- mba.surf(LIDAR, 300, 300, extend=TRUE)$xyz.est
# Image plot of the surface.
image(mba.int, xaxs = "r", yaxs = "r")
# Perspective plot of the surface.
persp(mba.int, theta = 135, phi = 30, col = "green3", scale = FALSE,
ltheta = -120, shade = 0.75, expand = 10, border = NA, box = FALSE)
# For a good time, I recommend using rgl.
library(rgl)
# Exaggerate z a bit for effect.
mba.int$z <- 10*mba.int$z
# Make nice colors for the rgl surface.
zlim <- range(mba.int$z)
zlen <- zlim[2] - zlim[1] + 1
colorlut <- terrain.colors(zlen) # Height color lookup table.
col <- colorlut[mba.int$z - zlim[1] + 1 ] # Assign colors to heights for each point.
open3d()
surface3d(mba.int$x, mba.int$y, mba.int$z, color = col)
}
Run the code above in your browser using DataLab