使用“表达”在R rgl轴标签中 [英] Using "expression" in R rgl axis labels

查看:176
本文介绍了使用“表达”在R rgl轴标签中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

rgl例程是否接受使用希腊字母的表达式和轴标签的超级/子脚本?





  xlab =(表达式(paste(Lyman ,)alpha)))

在正常情节调用中工作得很好,但似乎只显示 (粘贴(莱曼,阿尔法))作为我的轴标签在plot3d和decorate3d。如果不是,我怎样才能将这些字符添加到我使用plot3d生成的3D散点图?

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

粘贴到普通文本也会成功:

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


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?

解决方案

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

这篇关于使用“表达”在R rgl轴标签中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆