Path: news.mathworks.com!not-for-mail
From: "Buffy Summers" <offdar@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: help with graph
Date: Wed, 1 Aug 2007 21:21:00 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <f8qtfs$hrn$1@fred.mathworks.com>
References: <f8qhke$rhe$1@fred.mathworks.com> <f8qpi0$62b$1@fred.mathworks.com>
Reply-To: "Buffy Summers" <offdar@gmail.com>
NNTP-Posting-Host: webapp-01-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1186003260 18295 172.30.248.36 (1 Aug 2007 21:21:00 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 1 Aug 2007 21:21:00 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1071558
Xref: news.mathworks.com comp.soft-sys.matlab:422103



Thank you very very much!
Do you also have a solution for the name problem?
for ix to be string and not a number?
Thank you!

"us " <us@neurol.unizh.ch> wrote in message <f8qpi0$62b$1@fred.mathworks.com>...
> 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