[R] Remove squares from scatter3D

Peter Ehlers ehlers at ucalgary.ca
Wed Jun 23 18:25:47 CEST 2010


On 2010-06-22 15:40, moleps wrote:
> Dear All,
>
> I´ve been trying to find an option to scatter3D from rcmdr to remove the individual points from the plots but to no help so far. Removing the residuals is easy, but I cannot find a similar point option. Is there such an option that can be set to FALSE?
>

Are you trying to plot a regression plane without the data points?
I can't think of a good reason, but you could presumably use rgl
directly.

Using scatter3d, this may be possible with some setting for the
point.col argument but I couldn't see it.

You can always modify the scatter3d() code. A quick look shows
that it might suffice to wrap the call to rgl.spheres and/or
rgl.points in a test for whether to draw points or not.

Here's what worked for me:

1. copy scatter3d() to myscatter3d()
2. add an argument: draw.points = TRUE
3. wrap the code (near top of scatter3d)

      size <- sphere.size * ((100/length(x))^(1/3)) * 0.015

      .... (more code)

           else rgl.points(x, y, z,
             color = surface.col[as.numeric(groups)])
     }

   with

     if(draw.points){}

Be warned: I haven't tested this much, haven't studied the
rest of scatterplot3d() much, and I have not tried to use
Rcmdr's menus.

   -Peter Ehlers

>
> Best,
>
> //M
>



More information about the R-help mailing list