[R] Superscript in y-axis of plot

2009-06-16 Thread Steve Murray

Dear all,

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)


Any advice would be much appreciated,

Steve


_

[[elided Hotmail spam]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Superscript in y-axis of plot

2009-06-16 Thread Philipp Pagel
On Tue, Jun 16, 2009 at 10:01:00AM +, 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/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Superscript in y-axis of plot

2009-06-16 Thread baptiste auguie

For the sake of brevity, I like to use this trick,


plot(0, 0)
mtext(~Monthly Precipitation (mm x *10^2*/month))


HTH,

baptiste

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.