plotyy with different x ranges

1 vue (au cours des 30 derniers jours)
Binu
Binu le 13 Déc 2016
Commenté : Binu le 13 Déc 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 commentaires
Jan
Jan le 13 Déc 2016
Please post your code. Actually there is no problem with joining 2 lines with different X-ranges.
Binu
Binu le 13 Déc 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)')

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Combine Multiple Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by