英文:
Need axis title labeled "δ13C (‰)" but with the 13 as a superscript
问题
我在寻找正确的代码来在轴标题中包含上标。我需要轴标题标为"δ13C (‰)",但13要作为上标显示在字母C的前面。
yaxis <- expression("δ^13*C "(‰)")
英文:
I'm having issues finding the right code to include a superscript in my axis title. I need the axis title labeled "δ13C (‰)" but with the 13 as a superscript on the letter C at the front of the letter.
yaxis <- expression(""δ^13*C "(‰)")
I have tried many combinations but above is the code I have right now and it is not working.
答案1
得分: 1
"如常,?plotmath
包含了使其工作的咒语。例如:
yaxis <- expression(delta^13*C ~ "\U2030")
plot(1, ylab=yaxis)
大部分内容都是不言自明的(例如,delta 在表达式中写入 δ
),但供参考,千分号 字符的 Unicode 字符可以在 Windows 字符映射中找到,并使用 \U
表示:
"\U2030"
[1] "‰"
英文:
As always, ?plotmath
has the incantations to get this to work. E.g.:
yaxis <- expression(delta^13*C ~ "\U2030")
plot(1, ylab=yaxis)
Most of this is self-explanatory (e.g. delta writes a δ
in an expression), but for reference, the unicode character for the per mille character can be found in the Windows Character Map, and referenced with the \U
notation:
"\U2030"
[1] "‰"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论