Path: news.mathworks.com!not-for-mail
From: "Pekka Kumpulainen" <pekka.nospam.kumpulainen@tut.please.fi>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Exclude line from plot ledgend
Date: Wed, 21 Jan 2009 08:31:02 +0000 (UTC)
Organization: Tampere University of Technology
Lines: 11
Message-ID: <gl6mg6$h77$1@fred.mathworks.com>
References: <gl2mh5$fkt$1@fred.mathworks.com> <gl3529$e9s$1@fred.mathworks.com> <gl53q9$ir5$1@fred.mathworks.com>
Reply-To: "Pekka Kumpulainen" <pekka.nospam.kumpulainen@tut.please.fi>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1232526662 17639 172.30.248.37 (21 Jan 2009 08:31:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 21 Jan 2009 08:31:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 218565
Xref: news.mathworks.com comp.soft-sys.matlab:512851

"Sebastian Gatzka" <sebastian.gatzka.NOSPAM@stud.tu-darmstadt.de> wrote in message <gl53q9$ir5$1@fred.mathworks.com>...
> Thats it!
> Thank you!

That works if you want to drop the last one. It will only change the labels but keeps the linestyles and colors of the first 3 lines.
You can use the line handles to control which you want in the legend. 
Say you have an array hl containing the line handles (hl = plot(mydata))
then legend(hl([1 3 4]),'Line1','Line3','Line4') will use the right lines in the legend.
If you need to tweak then a lot it might be easier to set the DisplayName property of the line objects and you don't need to type the texts in each call to legend.