[R] Greek symbols (again but more complicated)

2010-09-05 Thread John Helly
Hi.

I'm trying to get 'mu' to show up as a Greek symbol but, despite trying every 
example I could find, can't get it to work.  Any insights would be welcome.

This is what I'm using that works, but displays mu with the letter u.

plotTimeXMastPAR - qplot(DT,MastPAR, data=A, xlab = , ylab = quote(PAR (uE 
~m^-2 ~s^-1)), geom=line) + opts(legend.position=none)

This is an attempt to get mu to look right but it does not work.  It doesn't 
fail but nothing inside the expression statement gets displayed.

plotTimeXMastPAR - qplot(DT,MastPAR, data=A, xlab = , ylab = c(PAR, 
expression(mu, quote(E ~m^-2 ~s^-1))), geom=line) + 
opts(legend.position=none)

Cheers.
--
John Helly, UCSD / San Diego Supercomputer Center / Scripps Institution of 
Oceanography, Climate, Atmospheric Science, and Physical Oceanography / +01 760 
840 8660 mobile / stonesteps (Skype) / stonesteps7 (iChat) / 
/www.sdsc.edu/~hellyj

__
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] Greek symbols (again but more complicated)

2010-09-05 Thread Dieter Menne


John Helly wrote:
 
 I'm trying to get 'mu' to show up as a Greek symbol but, despite trying
 every example I could find, can't get it to work. 
 
 
Try 

library(ggplot2)
qplot(mpg, wt, data=mtcars, xlab = ,  ylab = bquote(mu~(E ~m^-2~s^-1)),
geom=line) 

(thanks to Baptiste and David in 
http://r.789695.n4.nabble.com/How-to-plot-an-expression-label-with-variable-text-td2341465.html#a2341504
)

And please always use reproducible code for posting as above; your code had
the data set missing, which was totally irrelevant anyway, and ggplot2 was
missing.

Dieter




-- 
View this message in context: 
http://r.789695.n4.nabble.com/Greek-symbols-again-but-more-complicated-tp2527408p2527418.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Greek symbols (again but more complicated)

2010-09-05 Thread David Winsemius


On Sep 5, 2010, at 11:41 AM, John Helly wrote:


Hi.

I'm trying to get 'mu' to show up as a Greek symbol but, despite  
trying every example I could find, can't get it to work.  Any  
insights would be welcome.


This is what I'm using that works, but displays mu with the letter u.

plotTimeXMastPAR - qplot(DT,MastPAR, data=A, xlab = , ylab =  
quote(PAR (uE ~m^-2 ~s^-1)), geom=line) +  
opts(legend.position=none)




I suppose most readers will know by now that qplot is part of ggplot2,  
but it would be better manners to include the require() statement that  
would identify the non-base package, as would inclusion of a working  
example:


require(ggplot2)

qplot(mpg, wt, data=mtcars, ylab=expression(PAR*(mu*E~m^-2~s^-1)))

or
qplot(mpg, wt, data=mtcars, ylab=quote(PAR*(mu*E~m^-2~s^-1)))


This is an attempt to get mu to look right but it does not work.  It  
doesn't fail but nothing inside the expression statement gets  
displayed.


plotTimeXMastPAR - qplot(DT,MastPAR, data=A, xlab = , ylab =  
c(PAR, expression(mu, quote(E ~m^-2 ~s^-1))), geom=line) +  
opts(legend.position=none)


Cheers.
--
John Helly, UCSD / San Diego Supercomputer Center / Scripps  
Institution of Oceanography, Climate, Atmospheric Science, and  
Physical Oceanography / +01 760 840 8660 mobile / stonesteps  
(Skype) / stonesteps7 (iChat) / /www.sdsc.edu/~hellyj


__
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.


David Winsemius, MD
West Hartford, CT

__
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.