Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: bar same X-axis two Y axis
Date: Sat, 3 Jan 2009 04:21:02 +0000 (UTC)
Organization: Sherbrooke
Lines: 42
Message-ID: <gjmp3e$gea$1@fred.mathworks.com>
References: <gje1jo$4p4$1@fred.mathworks.com> <gjf07v$3kc$1@fred.mathworks.com> <gjf8q9$cfm$1@fred.mathworks.com> <gjlq54$9dp$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1230956462 16842 172.30.248.35 (3 Jan 2009 04:21:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 3 Jan 2009 04:21:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 894239
Xref: news.mathworks.com comp.soft-sys.matlab:509603


Thanks Steve and receives my best wish for the new year. 

The problem of scales is overcame  now, but it remains two lasts problems. 

First, both bars have the same color. How to select the blue color for example for the first bar, and the red color for the second bar ?

Second, the  X-axis has undesirable limit, I have tried to resolve this by using the code Xlimit([-1, 31]), unfortunately, without sucess. How to resolve this problem?

My best regards
Pat.



"Steven Lord" <slord@mathworks.com> wrote in message <gjlq54$9dp$1@fred.mathworks.com>...
> 
> "Et'o Pat" <patmbom@hotmail.com> wrote in message 
> news:gjf8q9$cfm$1@fred.mathworks.com...
> >I have used this syntax,
> > plotyy(x1, s, per,z, @bar, @bar),
> >
> > but an other problem occurs:  both bars overlaped.  How two separate them 
> > ?
> 
> Your message said, in part:
> 
> "Can you help me to draw a multi-bar with the same X-axis and two-Y axis "
> 
> If x1 and per overlap, so will the bars they plot (because they will be 
> using the same X axis.)  You may want to write the calls to BAR as anonymous 
> functions, and specify the width parameter to make the bars narrower.
> 
> f1 = @(x, y) bar(x, y, 0.4);
> f2 = @(x, y) bar(x, y, 0.3); % even narrower
> plotyy(x1, s, per, z, f1, f2);
> 
> *snip the rest*
> 
> -- 
> Steve Lord
> slord@mathworks.com 
>