Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using "expression" in R rgl axis labels

Tags:

r

graphics

3d

rgl

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?

like image 226
Karen Aplin Avatar asked Oct 20 '22 12:10

Karen Aplin


1 Answers

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) ) )
like image 137
IRTFM Avatar answered Oct 28 '22 19:10

IRTFM