[R] [Q] use of expression() in plot() vs. hist()

George White gwhite at bodnext.bio.dfo.ca
Thu Feb 18 19:12:52 CET 1999


On Thu, 18 Feb 1999, Peter Dalgaard BSA wrote:

> Alex Buerkle <cbuerkle at bio.indiana.edu> writes:
> 
> > In plot() I can get greek symbols into text items without trouble.
> > However, some of the same commands don't work as I would expect with
> > hist(). See the example below.
> 
> First of all, I don't know where people are getting that paste()
> construction from. The juxtaposion operator for plotting math is "*",
> i.e. 
> 
> hist(c(0,0,0,0,4,5,6,6,6,8), xlab=expression("scaled "*rho))
> 
The use of "paste" comes from careful reading of the documentation:

> ?legend
[...]
     ex.cs1 <- expression(plain(sin) * phi,  paste("cos", phi))# 2 ways
     legend(-3, .9, ex.cs1, lty=1:2, col=2:3)

"paste" and "*" are both used in "?text" as well.

--
George White <aa056 at chebucto.ns.ca>  tel: 902.426.8509
  Bedford Inst. of Oceanography, Nova Scotia, Canada.


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list