Search code examples
rgraphics3drgl

Using "expression" in R rgl axis labels


Do the rgl routines accept the use of "expression" for Greek letters and super/sub script for axis labelling?

Something like

xlab=(expression(paste("Lyman ",alpha,)))

works perfectly well in a normal plot call but just seems to display "(paste("Lyman ",alpha,)" as my axis label in plot3d and decorate3d. If not, how can I add these characters to my 3D scatterplots generated using plot3d?


Solution

  • On my system (OSX 10.7.5, R 3.1.2) I get an alpha as xlab with:

    require(rgl)
    plot3d(1,1,1,xlab=intToUtf8(0x03B1L) )
    

    And pasting to ordinary text also succeeds:

    plot3d(1,1,1, xlab=paste("Lyman ", intToUtf8(0x03B1L) ) )