plotyy with different x ranges

1 次查看(过去 30 天)
Binu
Binu 2016-12-13
评论: Binu 2016-12-13
Hi I want to use plotyy with different x ranges; temperature - from 01jan2016 to 31mar2016 pressure - from 20Jan2016 to 20mar2016 And I need x axis to use the larger date range, 01jan2016 to 31mar2016.Any help is highly appreciated. thanks
  2 个评论
Jan
Jan 2016-12-13
Please post your code. Actually there is no problem with joining 2 lines with different X-ranges.
Binu
Binu 2016-12-13
infile=xlsread('Pre_Temp_2016.xls');
pressure=infile(:,2);
dd_pres=infile(:,1)+693960;
temperature=infile(:,6);
dd_temp=infile(:,5)+693960;
[ax,p1,p2] = plotyy(dd_pres,pressure,dd_temp,temperature,'plot');hold on set(p1,'color','red') set(p2,'color','green') set(ax(1),'YLim',[1000 1040]) set(ax(1),'YTick',[1000:10:1040]) set(ax(2),'YLim',[20 25]) set(ax(2),'YTick',[20:5:25]) % here I need to handle the x axis with the range of pressure dates. ylabel(ax(1),'Barometric Pressure (hPa)') ylabel(ax(2),'Temperature (deg)')

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Combine Multiple Plots 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by