On Fri, 30 Jul 2004, Roy, Supratik wrote:

>
> I tried to include LaTeX expressions in the header of a plot in R.
> (1) Using PlotMath, LaTeX type expressions, e.g., R^x is possible, however,
> dist<-"...." (some string)
> ....main=expression(R^x,dist)....
> does not substitute the value of dist, as well do the proper superscripting.
> Also within an expression, substitute does not work, (apparently), so that
> explicit substituting of "dist" does not take place.


Working from the example in FAQ 7.15 suggests something like
 dist=" is the xth power of R"
 plot(rnorm(10),main=substitute(R^x*dist,list(dist=dist)))

which works fine. A slightly more compact version is
  plot(rnorm(10),main=bquote(R^x*.(dist)))

If that output isn't what you want you will need to explain what you want
more precisely.

        -thomas

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to