[R] Greek letters and subscripts in axis labels or titles

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed May 12 14:43:42 CEST 2004


Andersson, Henrik wrote:

> A very brief question.
> 
> I have managed to put greek letters in my axis labels using
> expression().
> 
> Question is, is there an easier (shorter) way than typing 
> 
> plot(runif(10),ylab=expression(NH[4]~(mu~M)),xlab="Time (h)")
> 
> to get the subscripts and micro sign.
> 
> Like NH$_4$ $\mu M$ would be nice :)

No, and your R version already *is* shorter:

nchar("NH$_4$ $\mu M$")
[1] 13
nchar("NH[4]~(mu~M)")
[1] 12

Uwe Ligges



> -------------------------------------------------------------
> Henrik Andersson
> Netherlands Institute of Ecology -
> Centre for Estuarine and Marine Ecology
> P.O. Box 140
> 4400 AC Yerseke
> Phone: +31 113 577473
> h.andersson at nioo.knaw.nl
> http://www.nioo.knaw.nl/ppages/handersson
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list