Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Set legend regardless of plot
Date: Tue, 9 Dec 2008 15:00:19 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 10
Message-ID: <ghm163$20g$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1228834819 2064 172.30.248.37 (9 Dec 2008 15:00:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 9 Dec 2008 15:00:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1634745
Xref: news.mathworks.com comp.soft-sys.matlab:505860


Hi,
I'm having trouble setting my legend correctly. I have 3 sets of data plotted in a for loop which plot mulitple lines each. I want a single line in the legend with a corresponding colour not an entry for each line.

The line my books and searches on the internet have suggested is:
legend('-b','Ganymede','-g','Callisto','-k','Europa');

but this displays six legend entrys - all of the same colour as the first 6 lines calculated in the loop. Hopefully I'm missing something silly!

Cheers,
Chris