Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Exclude line from plot ledgend
Date: Tue, 20 Jan 2009 00:15:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <gl3529$e9s$1@fred.mathworks.com>
References: <gl2mh5$fkt$1@fred.mathworks.com>
Reply-To: "Sadik " <sadik.hava@gmail.com>
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 1232410505 14652 172.30.248.37 (20 Jan 2009 00:15:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 20 Jan 2009 00:15:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:512585

"Sebastian Gatzka" <sebastian.gatzka.NOSPAM@stud.tu-darmstadt.de> wrote in message <gl2mh5$fkt$1@fred.mathworks.com>...
> Hello World.
> 
> I have added a line object to my plot, which is displayed in the legend now.
> I have read, that I can suppress the output inside the legend, but havent found a way of doing it by now.
> What is the right syntax for it?
> 
> Thanks in advance. S.

Hello Sebastian,

To do that, you need the handle to the legend.

So, let us say you have 4 such lines plotted on top of each other, and you say:

legendHandle = legend('line1','line2','line3','line4');

then, you would like to suppress line4. What you should do is

legend(legendHandle,'line1','line2','line3')

Hope this helps.