Andersson, Henrik
2004-May-12 12:36 UTC
[R] Greek letters and subscripts in axis labels or titles
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 :) ------------------------------------------------------------- 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
Uwe Ligges
2004-May-12 12:43 UTC
[R] Greek letters and subscripts in axis labels or titles
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