[R] Superscript in y-axis of plot

Philipp Pagel p.pagel at wzw.tum.de
Tue Jun 16 13:05:41 CEST 2009


On Tue, Jun 16, 2009 at 10:01:00AM +0000, Steve Murray wrote:
> I've been trying to superscript the '2' in the following command (I
> don't want the '^' displayed), but as yet haven't had much luck.
> I've tried both the paste and expression commands, but neither have
> brought me any joy!
> 
> mtext(side=2, line=5.5, "Monthly Precipitation (mm x 10^2/month)",
> font=2, cex=1.1)

expresison() routinely confuses me, too, although I've used it many times
before... This should work:

mtext(expression(paste("Monthly Precipitation (mm x ",10^2,"/month)"))

?plotmath is full of good examples.

cu
	Philipp

-- 
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
85350 Freising, Germany
http://webclu.bio.wzw.tum.de/~pagel/




More information about the R-help mailing list