本文介绍了向轴标题添加希腊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在R中的条形图的y轴上添加一个希腊字符.
问题是我需要将此字符集成到标题中.我想写:
I want to add a greek character to the y-axis of my barplot in R.
The problem is that I need this character to be integrated in the title. I want to write:
Diameter of aperture ("mu"m)
在轴标签中.
使用
ylab=expression()
我可以写希腊字符,
ylab="axis title"
我可以在标题之间加上适当的空格来写标题.
I can write the title with proper spaces between the words.
但是我找不到一种将所有这些放在一起并在轴标签中写上带有希腊词的正确标签的方法.我希望我足够清楚.
But I can't find a way to put all these together and write a proper label with a greek word in the axis label. I hope I was clear enough.
推荐答案
如果您使用的是plotmath{grDevices}
,则是主要的帮助页面( plotmath )包含您想要的示例:
If you're using plotmath{grDevices}
, the main help page (plotmath) contains an example of what you appear to want:
xlab = expression(paste("Phase Angle ", phi))
或者您的情况,我想:
ylab = expression(paste("Diameter of aperture ( ", mu, " )"))
这对您有用吗?
这篇关于向轴标题添加希腊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!