[R] overlaying points and lines on a surface3d rgl plot with axes

Vivek Sutradhara viveksutra at gmail.com
Thu Oct 19 16:47:02 CEST 2017

Hi R users and experts,
I am interested in learning more about the use of 3D plots. Specifically, I
want to add points and lines to a surface plot. And get the axes and labels
plotted also. Here is what I have tried with an example data set :

vol2 <- 2*volcano # Exaggerate the relief
mvol2 <- melt(vol2)
# First, persp and persp3d plots do not succeed
# Error - Increasing 'x' and 'y' values expected ??
# Next, tried to get the axes with the plot3d command
# then get the surface - why the x,z, y  sequence?

I get the following error message for the surface3d command :
Error in rgl.surface(x = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L,  :
  Bad dimension for cols

Additionally, I want points and lines plotted. For example, the points
(1,1,200) and (51,2,232).
I don't seem to have succeeded at any single step. I would appreciate any
help that I can get.

	[[alternative HTML version deleted]]

More information about the R-help mailing list