[R] ggplot sub- and superscript for axis name

Benoit Boulinguiez benoit.boulinguiez at ensc-rennes.fr
Tue Aug 31 15:29:17 CEST 2010


Hi all,

For publication purpose, I require to label ggplot figures axes with  
sub- or superscript text.
I tried several ways, but never worked so far, to mix character  
string, sub- or superscripting on it and even worse, mathematical  
symbols.

Let say I want to write the LateX equivalent of \gamma_{fi} in a  
ggplot element name, how can I do that?


#dumb example

foo<-data.frame(a=seq(1:100),b=rnorm(100,1,1))
p<-ggplot(data=foo,aes(x=a,y=b))
p<-p + geom_point()
p<-p + scale_x_continuous(name='gamma[fi]')
print(p)



Regards
Ben



More information about the R-help mailing list