From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: plotyy problem with shifted x axis
Date: Tue, 22 Mar 2011 18:29:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <imapph$5g3$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1300818545 5635 (22 Mar 2011 18:29:05 GMT)
NNTP-Posting-Date: Tue, 22 Mar 2011 18:29:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2680817
Xref: comp.soft-sys.matlab:717444

Hello I have troubles with plotyy

I have data in matrix M1 in format f.e.:
2011 01 01 13 56 00 20 20 125 136 0.18 65
first six rows are date time the next are traffic data...
I am computing final 
 TimeAxe = datenum(M1(:,1),M1(:,2),M1(:,3),M1(:,4),M1(:,5),M1(:,6));
  plotyy(TimeAxe, M1(:,7), TimeAxe, M1(:,8));

but 1st and second lines are shifted to itself. this is visible on this image

when I delete datetick, graph is normal, can please tell me why is this done and help me to remove shift? I tried 

  [AX,Int,Spd] = plotyy(TimeAxe, M1(:,7),TimeAxe, M1(:,8),'plot');  
         set(get(AX(1),'Ylabel'),'String','Intenzita VJ/km');
         set(get(AX(2),'Ylabel'),'String','Rychlost km/h');


but without any success.

Thank you for your help. Martin
P.S. is it possible to set min and max on y axes? sth like using axes(xmin,xmax,ymin,ymax)???
thank you once again for quick answer. Martin