[R] rgl package: color of the axes

Gaspard Lequeux Gaspard.Lequeux.at at biomath.ugent.be
Wed Aug 23 22:13:40 CEST 2006


Hej,

When plotting triangles with rgl.triangles and setting the axes afterwards 
with decorate3d(aspect=TRUE), the axes get the color used for the last 
triangle plotted.

Example:

rgl.triangles(c(1,2,3),c(1,2,5),c(1,3,2),col="#55FF55")
decorate3d(aspect=TRUE)

Using

decorate3d(aspect=TRUE,col="#000000")

or

decorate3d(aspect=TRUE,color="#000000")

does not help, the axes still have the last color used for plotting an 
object.

In the help page of decorate3d on can find the following line:

        ...: additional parameters which will be passed to 'par3d',
             'material3d' or 'decorate3d'.

So the 'color' argument should have an effect.

The workaround is simple. Set the color with rgl.material before calling 
decorate3d:

rgl.material(color="#000000")

Maybe this should be done directly in the decorate3d function, as written 
in the help?

Version of rgl used: 0.67-2 (2006-07-11)
Version of R used: R 2.3.1; i486-pc-linux-gnu; 2006-07-13 01:31:16;

Anyway, rgl is an excellent package.

/Gaspard



More information about the R-help mailing list