Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: bar plot BaseValue
Date: Sat, 21 Nov 2009 13:45:10 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 27
Message-ID: <he8qt6$pi6$1@fred.mathworks.com>
References: <he72dv$2c0$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 1258811110 26182 172.30.248.37 (21 Nov 2009 13:45:10 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 21 Nov 2009 13:45:10 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1377695
Xref: news.mathworks.com comp.soft-sys.matlab:586875


I tried loop:
-------------------
% y is 20x3 matrix
% base_value is 1x20 array
for i=1:20
    bar(i, y(i, 1:3), 'stack', 'BaseValue', base_value(i));
end
-----------------
It doesn't work. 
??? Error using ==> bar at 57
X must be same length as Y.

Seems can't plot bars one by one.  can anybody help? 
Thanks a lot!



"Bo " <seumit@163.com> wrote in message <he72dv$2c0$1@fred.mathworks.com>...
> Hi,
> 
> I wanted to plot "bar" plot in "stack" style.  
> I can use BaseValue property to set specific base value.
> But how can I plot each group on a different base value?
> 
> Thanks a lot!
> 
> Bo