Skip to content
Back to formatted view

Raw Message

Message-ID: <F44DEB6F-D3B2-4C95-813A-B9E8C570BCAA@comcast.net>
Date: 2012-11-12T14:51:54Z
From: David Winsemius
Subject: Two-line title in R legend
In-Reply-To: <B283446227ABB1479E7F27937D8A984D020A50B173@PO2MBX03.po2.comcast.net>

On Nov 11, 2012, at 7:13 PM, Gabriel Toro wrote:

> Hi,
> 
> I am trying to use a legend title that is a bit too long for one line.  To try to break the title in two lines, I am using
> 
> legend (title="Top of Title\nbottom of title",  etc.  )
> 
> R prints the title as two lines, but the top line is outside the legend box.
> 
> How can I trick the R legend function to make the legend box taller so that it contains the top line?
> 

You should include an example with dummy data if you wnat tested solutions. You can try:

legend (title=atop("Top of Title","bottom of title"), ...  )

Plotmath expression are not allowed to have "\n" in them, as stated in the help page.

-- 
David Winsemius, MD
Alameda, CA, USA