[R] 3D Graph Surface and single points (eg wireframe with points)

Karl Knoblick karlknoblich at yahoo.de
Mon Oct 31 23:11:35 CET 2011


Hallo!
 
I just want to make a 3D plot of a surface of a cone and want to plot some single points around.
 
I tried wireframe but cannot find how to plot single points
 
I tried scatterplot3d but there the surface is not simple to plot. And: How can I rotate the point of view by the z-axis
 
I tried persp3d but how can I add some single points?
 
Example:
 
library(lattice)
library(scatterplot3d)

#data
d <- expand.grid(x = 1:10, y = 5:15)
d$z <- sqrt((d$x-4)^2 + (d$y-10)^2) 

wireframe(z ~ x * y, data = d, drape=T)
# How to plot points??
              
scatterplot3d(d$x, d$y, d$z)
# How to plot nice surface?
# How to rotate point of view by z axis?
# BTW: points3d should add some points (does not work for me)

# persp3d no example
 
 
Can anybody help? Has anybody such an example?
 
Actually, I think it is possible with R to dray such 3D plots - the question is how? Even possible to animate the 3D plot? Or rotate interactive?
 
 
Best regards
Karl



More information about the R-help mailing list