[R] Plot a sphere

Branimir K. Hackenberger hack at pedos.hr
Fri Dec 26 14:14:12 CET 2003


To plot the sphere in R I find the best scatterplot3d package as
follows:

library(scatterplot3d)
a=seq(-pi,pi, length=100)
x=c(rep(1, 100) %*% t(cos(a)))
y=c(cos(a) %*% t(sin(a)))
z=c(sin(a) %*% t(sin(a)))
scatterplot3d(x, y, z, type="l")

Best regards

Branimir K. Hackenberger




More information about the R-help mailing list