[R] rgl and axes3d() labels

Duncan Murdoch murdoch.duncan at gmail.com
Thu Apr 24 13:05:32 CEST 2014


On 23/04/2014, 9:02 PM, Alex Reynolds wrote:
> Unfortunately, that doesn't help as it removes axis lines. It looks like
> I can't use segments3d() without knowing what the bounds are of the
> current axes and I don't know what to call to expose those.
>
> Thanks again for your help, though, I appreciate it. Hopefully this gets
> fixed in a future release!

There is no bug, so it won't be fixed.

Duncan Murdoch

>
> -Alex
>
>
> On Wed, Apr 23, 2014 at 5:34 PM, Duncan Murdoch
> <murdoch.duncan at gmail.com <mailto:murdoch.duncan at gmail.com>> wrote:
>
>     On 23/04/2014, 7:51 PM, Alex Reynolds wrote:
>
>         I am making an rgl-based 3d plot. It works fine, except when I
>         try to
>         remove axis value labels and tick marks with axes3d(labels=FALSE,
>         ticks=FALSE):
>
>         ---------------------------
>         rgl.open()
>         offset <- 50
>         par3d(windowRect=c(offset, offset, 1280+offset, 1280+offset))
>         rm(offset)
>         rgl.clear()
>         rgl.viewpoint(theta=__thetaStart, phi=30, fov=30, zoom=1)
>         spheres3d(df$PC1, df$PC2, df$PC3, radius=featureRadius,
>         color=df$rColor,
>         alpha=featureTransparency, shininess=featureShininess)
>         aspect3d(1, 1, 1)
>
>         /* ------ */
>         axes3d(col='black', box=FALSE, labels=FALSE, ticks=FALSE)
>         /* ------ */
>
>         title3d("", "", "PCoA1", "PCoA2", "PCoA3", col='black', line=1)
>         texts3d(df$PC1, df$PC2, df$PC3, text=df$ctName, color="blue",
>         adj=c(0,0))
>         bg3d("white")
>         rgl.clear(type='lights')
>         rgl.light(-45, 20, ambient='black', diffuse='#dddddd',
>         specular='white')
>         rgl.light(60, 30, ambient='#dddddd', diffuse='#dddddd',
>         specular='black')
>         filename <- paste("results/PCoA.labeled.__pdf", sep="")
>         rgl.postscript(filename, fmt="pdf")
>         ---------------------------
>
>         When I run this code, these flags are ignored and I still get
>         axis labels
>         and tick marks. What am I misunderstanding about the documentation?
>
>
>     If you specify edges="bbox" (the default), labels is ignored, and
>     the bbox3d() function is used to draw the axes.  There's no ticks
>     argument, so it'll be absorbed by the ... argument.
>
>     I don't know what you want, but you might get it with
>
>       axes3d(edges=c("x", "y", "z"), col='black', box=FALSE,
>     labels=FALSE, tick=FALSE)
>
>     This won't join the axis lines at the lower corner; if that's what
>     you want, I'd just draw them explicitly using segments3d.
>
>     BTW, mixing rgl.* functions with *3d functions is likely to give you
>     strange results.  I don't recommend it.
>
>     Duncan Murdoch
>
>




More information about the R-help mailing list