I have a matrix of x,y, and z values (19,268 values) that are arranged as a surface. I plotted the surface using:
rgl::surface3d(mat$x, mat$y, mat$z, color="grey")
But, I want the color to vary with height (my Z values). The z-values range from -1.377385 to 29.93678
.
How can I make my plot color vary with height?