anuari 2004 01:35
> To: Wolfgang Viechtbauer
> Cc: [EMAIL PROTECTED]
> Subject: Re: [R] Math Expression and Variable Value in Title
>
>
> Use substitute()
>
> n <- 20
> plot(0, 0, main = substitute(paste(n[i], " = ", k), list(k = n)))
>
> -roger
&g
Note that this will circumvent all the careful work in R to align the
plotmath text correctly. In your case that includes having space for the
subscript. It may not matter for main titles, but it certainly does for
ylab or axis annotation or
People might be producing PDF or Windows metaf
An alternative but also higly recommendable way is the use of the
psfrag-package in your LaTeX-file. It is furthermore very simple in use.
Type
plot(1:10, main="test")
in your LaTeX-file you insert in your figure-environment the command
\psfrag{test}{$n_i=20$}
before you call the \includegraphi
> "Roger" == Roger D Peng <[EMAIL PROTECTED]>
> on Wed, 28 Jan 2004 19:35:28 -0500 writes:
Roger> Use substitute()
Yes!
Roger> n <- 20
Roger> plot(0, 0, main = substitute(paste(n[i], " = ", k), list(k = n)))
but even better is
plot(0, 0, main = substitute(n[i]
Use substitute()
n <- 20
plot(0, 0, main = substitute(paste(n[i], " = ", k), list(k = n)))
-roger
Wolfgang Viechtbauer wrote:
Hello All,
I am trying to put a math expression into a plot title and at the same
time, I want a value in the title to depend on a variable that I set
earlier.
Simple Ex
Hello All,
I am trying to put a math expression into a plot title and at the same
time, I want a value in the title to depend on a variable that I set
earlier.
Simple Example:
n <- 20
plot(0, 0)
title(expression(paste(n[i], " = ", n)))
Obviously, I want "n_i = 20". How can I get that?
Thanks i