Greek and alpha numeric in ggplot2 axis labels

2020-06-12 03:28发布

问题:

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

回答1:

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


标签: r ggplot2