[R] Math Expression and Variable Value in Title

Salvatore Barbaro sbarbar at uni-goettingen.de
Thu Jan 29 09:51:50 CET 2004


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 \includegraphics{}

best regards

yours

s.













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 Example:
> 
> n <- 20
> plot(0, 0)
> title(expression(paste(n[i], " = ", n)))
> 
> Obviously, I want "n_i = 20". How can I get that?
> 
> Thanks in advance,
> 


-- 
Salvatore Barbaro
University of Goettingen
Department of Public Economics
Platz der Goettinger Sieben 3
D-37073 Goettingen
Phone: +49 551 3919704




More information about the R-help mailing list