Using “expression” in R rgl axis labels

只谈情不闲聊 提交于 2019-12-07 05:58:27

问题


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?


回答1:


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) ) )


来源:https://stackoverflow.com/questions/29988230/using-expression-in-r-rgl-axis-labels

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!