An Interactive 3D Plot in R
Join the DZone community and get the full member experience.Join For Free
Following along with my course in R, here's some code to make interactive 3D plots:
> library(rgl) > library(evd); > data(lossalae) > U=rank(lossalae[,1]+rnorm(nrow(lossalae), + mean=0,sd=.001))/(nrow(lossalae)+1) > V=rank(lossalae[,2])/(nrow(lossalae)+1) > M=kde2d(qnorm(U),qnorm(V),n=35) > library(rgl) > persp3d(M$x,M$y,M$z,col='green', + xlab="loss",ylab="alae",zlab="")
Published at DZone with permission of Arthur Charpentier, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.