将希腊字符添加到轴标题 [英] Adding greek character to axis title

查看:25
本文介绍了将希腊字符添加到轴标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 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))

或者对于你的情况,我猜:

or for your case, I guess:

ylab = expression(paste("Diameter of aperture ( ", mu, " )"))

这对你有用吗?

这篇关于将希腊字符添加到轴标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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