Re: [R] LaTeX in R

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Sat 31 Jul 2004 - 01:42:28 EST

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



R-help@stat.math.ethz.ch 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 Received on Sat Jul 31 02:03:03 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:22 EST