필터 지우기
필터 지우기

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