Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Greek and alpha numeric in ggplot2 axis labels

Tags:

r

ggplot2

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

like image 773
Sam Avatar asked Apr 05 '13 19:04

Sam


1 Answers

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)))
like image 194
joran Avatar answered Oct 22 '22 21:10

joran