plotyy with different x ranges

1 Ansicht (letzte 30 Tage)
Binu
Binu am 13 Dez. 2016
Kommentiert: Binu am 13 Dez. 2016
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 Kommentare
Jan
Jan am 13 Dez. 2016
Please post your code. Actually there is no problem with joining 2 lines with different X-ranges.
Binu
Binu am 13 Dez. 2016
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)')

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Two y-axis finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by