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 Center および File ExchangeCombine Multiple Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by