[R] Greek symbols on "ylab=" using barchart() {Lattice}

Gavin Simpson gavin.simpson at ucl.ac.uk
Fri Dec 11 11:06:49 CET 2009


On Wed, 2009-12-09 at 18:46 +0100, baptiste auguie wrote:
> barchart(1:2, ylab=expression("Concentration ("*mu*g/m^3*")"))

or

barchart(1:2, ylab=expression(Concentration ~ (mu*g/m^3)))

That way you don't have to worry about quoting parts of the expression.

G

> 
> 2009/12/9 Peng Cai <pengcaimaillist at gmail.com>:
> > Hi Baptiste and Others,
> >
> > Thanks for your help. I'm writing:
> >
> > ylab=expression(Concentration(mu*g/m^3))
> >
> > And its working fine, but is it possible to add a space between
> > "Concentration" and "(mu*g/m^3)".
> >
> > Thanks again,
> > Peng Cai
> >
> > On Wed, Dec 9, 2009 at 12:02 PM, baptiste auguie <
> > baptiste.auguie at googlemail.com> wrote:
> >
> >> Hi,
> >>
> >> try this,
> >>
> >> barchart(1:2, ylab=expression(mu*g/m^3))
> >>
> >> ?plotmath
> >>
> >> baptiste
> >>
> >> 2009/12/9 Peng Cai <pengcaimaillist at gmail.com>:
> >>  > Hi All,
> >> >
> >> > I'm trying to write "ug/m3" as y-label, with greek letter "mu" replacing
> >> "u"
> >> > AND "3" going as a power.
> >> >
> >> > These commands works in general:
> >> >
> >> > plot.new()
> >> > text(0.5, 0.5, expression(symbol("m")))
> >> >
> >> > But, I'm sure about how to do it using barchart() from "Lattice". Can
> >> anyone
> >> > help please?
> >> >
> >> > Thanks,
> >> > Peng Cai
> >> >
> >> >        [[alternative HTML version deleted]]
> >> >
> >> > ______________________________________________
> >> > R-help at 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<http://www.r-project.org/posting-guide.html>
> >> > and provide commented, minimal, self-contained, reproducible code.
> >> >
> >>
> >
> >        [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at 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.
> >
> 
> ______________________________________________
> R-help at 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.
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%




More information about the R-help mailing list