Although I see similar, but more complex, questions addressed in the help archive, I'm having trouble adding superscripted text to the y-axis labels of some figures, and I can't find anything in the R documentation on this. I have: ylab="BA (m2/ha)" but I want the "2" to be superscripted. Thanks in advence for the help, or for pointing out the appropriate help file. -Ben Osborne
See ?plotmath. plot(1:10, 1:10, ylab=expression(BA (m^{2}/ha))) Benjamin M. Osborne wrote:> Although I see similar, but more complex, questions addressed in the help > archive, I'm having trouble adding superscripted text to the y-axis labels of > some figures, and I can't find anything in the R documentation on this. > > I have: > > ylab="BA (m2/ha)" > > but I want the "2" to be superscripted. > Thanks in advence for the help, or for pointing out the appropriate help file. > > -Ben Osborne > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 452-1424 (M, W, F) fax: (917) 438-0894
On Mon, 13 Jun 2005, Benjamin M. Osborne wrote:> Although I see similar, but more complex, questions addressed in the help > archive, I'm having trouble adding superscripted text to the y-axis labels of > some figures, and I can't find anything in the R documentation on this. > > I have: > > ylab="BA (m2/ha)" > > but I want the "2" to be superscripted. > Thanks in advence for the help, or for pointing out the appropriate help file. >?plotmath _________________________________________________________________ David Scott Department of Statistics, Tamaki Campus The University of Auckland, PB 92019 Auckland NEW ZEALAND Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000 Email: d.scott at auckland.ac.nz Graduate Officer, Department of Statistics
Ben Others have pointed out plotmath. However, for some superscripts (including 2) it may be easier to use the appropriate escape sequence (at in Windows): ylab = 'BA (m\262/ha)' Cheers ........ Peter Alspach>>> "Benjamin M. Osborne" <Benjamin.Osborne at uvm.edu> 14/06/05 13:42:53 >>>Although I see similar, but more complex, questions addressed in the help archive, I'm having trouble adding superscripted text to the y-axis labels of some figures, and I can't find anything in the R documentation on this. I have: ylab="BA (m2/ha)" but I want the "2" to be superscripted. Thanks in advence for the help, or for pointing out the appropriate help file. -Ben Osborne ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html ______________________________________________________ The contents of this e-mail are privileged and/or confidenti...{{dropped}}