Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Legend for Pcolor
Date: Tue, 21 Oct 2008 02:06:02 +0000 (UTC)
Organization: Purdue University
Lines: 12
Message-ID: <gdjdea$5hv$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 1224554762 5695 172.30.248.37 (21 Oct 2008 02:06:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 21 Oct 2008 02:06:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 586970
Xref: news.mathworks.com comp.soft-sys.matlab:496424


I have been using pcolor to plot my data which has already been compressed to discrete values normally ranging from 0-6.  The commands are just

pcolor(mymatrix)  %with discrete values ranging from 0 to 6
colormap(grey(7))

I would like to have a legend with entries for each discrete value and have had no luck with the following:

legend('LabelFor0','LabelFor1','LabelFor2','LabelFor3'....

Does anyone know how to get a legend like that to work with pcolor?

Thanks