DTR(diurnal temperature range)是日較差,即最高溫和最低溫度的差值。一段時期平均DTR的增加或降低可以反映出一個區域內的氣候變化狀況。
load('Temmax1.mat');
load('Temmax2.mat');
load('Temmin1.mat');
load('Temmin2.mat');
DTR1=Temmax1-Temmin1;
DTR2=Temmax2-Temmin2;
%畫兩套數據的DTR
plot(DTR1,'r.-','linewidth',2);
hold on
plot(DTR2,'b.-','linewidth',2);
legend({'NCEP','Observed'},'Location','Northeast');
set(gca,'xtick',[2 7 12 17 22 27 32],'xticklabel',{'1980','1985','1990','1995','2000','2005','2010'});%在x軸特定位置上添加標註
set(gca, 'FontSize',10,'FontWeight','Bold','tickdir','out') %設置標註爲10號字、加粗、標記線向外
h=xlabel('Year'); %設置x軸名稱
set(h, 'FontSize',10,'FontWeight','Bold')
h=ylabel('Temperarure(\circC)'); %設置y軸名稱
set(h, 'FontSize',10,'FontWeight','Bold')
xlim([1 33])%x軸範圍鎖定爲1~33
box off %去掉外框
%畫兩套數據DTR的異常及其趨勢線
aDTR1=DTR1-mean(DTR1);
aDTR2=DTR2-mean(DTR2);
plot(aDTR1,'r.-','linewidth',2);%畫NCEP數據最高氣溫折線圖,紅色實線實心點
hold on
plot(aDTR2,'b.-','linewidth',2);
axis([ -inf inf -1 1]);
legend({'NCEP','Observed'},'Location','Northwest');
set(gca,'xtick',[2 7 12 17 22 27 32],'xticklabel',{'1980','1985','1990','1995','2000','2005','2010'});%在x軸特定位置上添加標註
set(gca, 'FontSize',10,'FontWeight','Bold','tickdir','out') %設置標註爲10號字、加粗、標記線向外
h=xlabel('Year'); %設置x軸名稱
set(h, 'FontSize',10,'FontWeight','Bold')
h=ylabel('Temperarure(\circC)'); %設置y軸名稱
set(h, 'FontSize',10,'FontWeight','Bold')
xlim([1 33])%x軸範圍鎖定爲1~33
box off %去掉外框
plot(aDTR2-detrend(aDTR2),'b--','linewidth',2);
plot(aDTR1-detrend(aDTR1),'r--','linewidth',2);
hold off
相關鏈接:
Matlab處理氣象數據——目錄