Skip to content

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

2 messages · Karl Knoblick, Duncan Murdoch

#
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
#
On 11-10-31 6:11 PM, Karl Knoblick wrote:
After drawing the surface with persp3d, just use points3d to add the 
points.  You say it didn't work for you, but you don't show what you 
did, so I have no idea what went wrong.

Duncan Murdoch