Peter,

Try par()$lheight

The catch is, you need to set it *before* the call to text()

par(lheight=.8) # closer together
text(x, y, "whatever\nsecondline")

The best place to find options like lheight is in ?par

Sarah

On Fri, Feb 18, 2011 at 6:41 PM, Peter Langfelder
<peter.langfel...@gmail.com> wrote:
> Hi all,
>
> tried to google but found nothing, so here goes the question: is there
> a way to control line spacing when displaying text in graphical mode
> (for example, using text())?
>
> As an example, run the following code:
>
> plot(c(0,1), c(0,1), type = "n", axes = FALSE, xlab = "", ylab = "")
> text(0.5, 0.5, "Line 1\nLine 2", cex = 3)
>
> Is there a way to control the line spacing between the text lines
> "Line 1" and "Line 2" in the resulting plot?
>
> Thanks!
>
> Peter
>


-- 
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to