3D Plotting in R - Using a 4th dimension of color 3D Plotting in R - Using a 4th dimension of color r r

3D Plotting in R - Using a 4th dimension of color


Just make a colormap, and then index into it with a cut version of your c variable:

x = rnorm(100)y = rnorm(100)z = rnorm(100)c = zc = cut(c, breaks=64)cols = rainbow(64)[as.numeric(c)]plot3d(x,y,z,col=cols)

enter image description here