Path: news.mathworks.com!not-for-mail
From: "us " <us@neurol.unizh.ch>
Newsgroups: comp.soft-sys.matlab
Subject: Re: help with graph
Date: Wed, 1 Aug 2007 20:13:52 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 21
Message-ID: <f8qpi0$62b$1@fred.mathworks.com>
References: <f8qhke$rhe$1@fred.mathworks.com>
Reply-To: "us " <us@neurol.unizh.ch>
NNTP-Posting-Host: webapp-00-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185999232 6219 172.30.248.35 (1 Aug 2007 20:13:52 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 1 Aug 2007 20:13:52 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:422095


Buffy Summers:
<SNIP colorful popsicles

> each value needs a bar in a different color with a differnt name...

one of the solutions

% the data
     nb=4;
     yb=rand(nb,1);
     cm=jet(nb); % <- a colormap, use your own nxrgb...
% the engine
     ix=[3,2,4,1]; % <- index into <cm>
     bh=bar(yb);
     ch=get(bh,'children');
     set(ch,...
           'facevertexcdata',ix.');
     colormap(cm);
     colorbar; % <- compare with bar color indices!

us