希腊文和ggplot2轴标签中的字母数字 [英] Greek and alpha numeric in ggplot2 axis labels

查看:137
本文介绍了希腊文和ggplot2轴标签中的字母数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用ggplot2制作一个轴名称为uL的图表,其中'u'是希腊语'mu'。

添加mu,我已经发现这个工作正常

  p < -  ggplot(data.frame(x = 1:3,y = 1:3),aes(x = x,y = y))+ geom_point()
p + ylab(表达式(mu))



但我一直没有能够放置任何东西。
这些不起作用
$ b $ pre $ p + ylab(粘贴(表达式(亩),foo))
p + ylab(expression(mu)〜foo)

预先致谢



Sam

解决方案

如何操作:
$ (数据帧(x = 1:3,y = 1:3),aes(x = x,y = y))+ b

  p < geom_point()
p + ylab(表达式(paste(mu,L)))


I would like to use ggplot2 to make a chart with a axis label of uL, where the 'u' is the greek 'mu'.
to add just mu, I have found this to work

p <- ggplot(data.frame(x = 1:3, y = 1:3), aes(x= x, y=y)) + geom_point()
p + ylab(expression(mu))

But I have not been able to place anything else alongside it. These do not work

p + ylab(paste(expression(mu), "foo"))
p + ylab("expression(mu)~foo")

Thanks in advance

Sam

解决方案

How about this:

p <- ggplot(data.frame(x = 1:3, y = 1:3), aes(x= x, y=y)) + geom_point()
p + ylab(expression(paste(mu,L)))

这篇关于希腊文和ggplot2轴标签中的字母数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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