[R] newline in plotmath expressions

Pascal A. Niklaus pascal.niklaus at ipw.agrl.ethz.ch
Tue Mar 14 14:07:12 CET 2006


Hi all,

When trying to amend a graphic with a text, I run into the following problem:

   text(10,10,"First line\nSecond line",pos=2)

works. However, because I have a plotmath expression, I tried:

   text(10,10,expression("First line with"[subscript]*"\nsecond line"),pos=2)

but \n does not lead to the result I wish. I considered the plotmath help page 
but could not find how to insert a newline. 

Is there a possibility to insert linebreaks in plotmath expressions, or do I 
have to print the individual lines with separete text commands?

Thanks for you help

Pascal




More information about the R-help mailing list