Over a million developers have joined DZone.

An Interactive 3D Plot in R

· Big Data Zone

Learn about how to rapidly iterate data applications, while reusing existing code and leveraging open source technologies, brought to you in partnership with Exaptive.

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="")

 

 

The Big Data Zone is brought to you in partnership with Exaptive.  Learn how Rapid Application Development powers business. 

Topics:

Published at DZone with permission of Arthur Charpentier , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}