Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: plotyy problem with shifted x axis
Date: Sun, 10 Apr 2011 14:54:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 36
Message-ID: <insgac$167$1@fred.mathworks.com>
References: <imapph$5g3$1@fred.mathworks.com> <imbjrs$glc$1@fred.mathworks.com> <imbkcp$p1r$1@fred.mathworks.com> <imc8a9$ank$1@fred.mathworks.com> <imclph$f4o$1@fred.mathworks.com> <imfcgh$53q$1@fred.mathworks.com> <insdeh$fj6$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1302447244 1223 172.30.248.48 (10 Apr 2011 14:54:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 10 Apr 2011 14:54:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2680817
Xref: news.mathworks.com comp.soft-sys.matlab:721109

In my case this works absoluterly, here is part of used code

    [AX,Int,Spd] = plotyy(TimeAxe, M1(:,8),TimeAxe, M1(:,7),'plot');
        set(AX(1),'Ylim',[0 200]); set(AX(2),'Ylim',[0 5000]);  
        % set(get(AX(1),'Ylabel'),'String','Rychlost km/h'); 
        % set(get(AX(2),'Ylabel'),'String','Intenzita v.j/3min'); 
        set(Int,'LineStyle','.','Color',[0.7 0.7 0.7]);datetick(AX(1),'x',15);
        set(Spd,'LineStyle','.','Color','c');datetick(AX(2),'x',15);
        grid; hold on; 

Use this as inspiration, If will not work, give us some part of code. Without that I canĀ“t help you.

Regards, Martin


"Jessica Lam" wrote in message <insdeh$fj6$1@fred.mathworks.com>...
> I got the same problem. Tried to use your code to fix it. But it does not work. 
> 
> "Martin Skodacek" wrote in message <imfcgh$53q$1@fred.mathworks.com>...
> > Thank you sadik for your help. plotyy in our appliction works nicely now.
> > Kind regards, Martin
> > 
> > "Sadik " <sadik.hava@gmail.com> wrote in message <imclph$f4o$1@fred.mathworks.com>...
> > > Hi Martin,
> > > 
> > > If you use allHandles while doing hold on, you may easily lose track. Therefore, it is better to use your AX variables as follows:
> > > 
> > > [AX,Int,Spd] = plotyy(TimeAxe, M1(:,7),TimeAxe, M1(:,8),'plot');
> > > datetick(AX(1),'x',15) % for M(:,7)
> > > datetick(AX(2),'x',15)
> > > 
> > > [AX2,Int,Spd] = plotyy(TimeAxe, M1(:,9),TimeAxe, M1(:,10),'plot');
> > > datetick(AX2(1),'x',15) % for M(:,9)
> > > datetick(AX2(2),'x',15)
> > > 
> > > Best.