Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Two lined legend entry
Date: Sat, 3 Jan 2009 01:34:02 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 12
Message-ID: <gjmfaa$5vf$1@fred.mathworks.com>
References: <gjm5se$ios$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1230946442 6127 172.30.248.35 (3 Jan 2009 01:34:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 3 Jan 2009 01:34:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869871
Xref: news.mathworks.com comp.soft-sys.matlab:509586


"Bruce " <brucebassi@yahoo.com> wrote in message <gjm5se$ios$1@fred.mathworks.com>...
> Does anyone know how to make one legend entry have two lines of text (rather than one very long line)?
> 
> Thanks
> Bruce

You can use SPRINTF:

>> plot(rand(10,2))
>> legend(sprintf('this has\ntwo lines'), 'this is one line')

jiro