Interactive 3d plot, in R

September 20, 2012
By

(This article was first published on Freakonometrics - Tag - R-english, and kindly contributed to R-bloggers)

Following the course of this afternoon, I will just upload some codes to make interactive 3d plots, in R.

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

To leave a comment for the author, please follow the link and comment on his blog: Freakonometrics - Tag - R-english.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , , ,

Comments are closed.