clear
load Figure3_data.mat

fs=10;

close all
figure
set(gcf,'unit','centimeters','position',[10,5,20,9])

% (a) Global MHW
ha1=axes('position',[0.045,0.64,0.29,0.325],'fontname','Times New Roman');
set(gcf,'currentaxes',ha1);
m_proj('Equidistant Cylindrical','lon',[0 360],'lat',[-80 90]);
m_contourf(Xa,Ya,MMMa,[0:40],'linestyle','none')
m_grid('linest','none','xticklabels',[],'yticklabels',[-60 -30 0 30 60 90],'fontsize',fs,'fontname','Times New Roman');
m_coast('patch',[.8 .8 .8]);
colormap(sunshine_9lev_2/255)
% colormap(ha1,sunshine_9lev_2/255)
caxis([0 40]); 
hc=colorbar('horizontal');
set(hc,'position',[0.045,.61,0.442,0.015],'Ticks',[0 10 20 30 40],'fontname','Times New Roman','fontsize',fs)
cbarrow('right') 
title('(a) MHW [2071-2100]','fontsize',fs,'fontname','Times New Roman')

% (b) Arctic MHW
ha2=axes('position',[0.33,0.64,0.17,0.334],'fontname','Times New Roman');
set(gcf,'currentaxes',ha2);
m_proj('stereographic','lat',90,'long',0,'radius',35,'rectbox','on');       
m_contourf(lon,lat,MMMa1,[0:40],'linestyle','none')
m_grid('linest',':','xticklabels',[],'ytick',[70 80],'yticklabels',[]);
m_coast('patch',[.8 .8 .8]);
colormap(ha2,sunshine_9lev_2/255)
caxis([0 40]); 
hc=colorbar('horizontal');
set(hc,'position',[0.045,.61,0.442,0.015],'Ticks',[0 10 20 30 40],'fontname','Times New Roman','fontsize',fs)
cbarrow('right') 
title('(b) MHW [2071-2100]','fontsize',fs,'fontname','Times New Roman')
text(-1.9,-0.76,'Annual total days under SSP585 (days)','fontsize',fs,'fontname','Times New Roman')

% (e) È«Çò THE
ha5=axes('position',[0.045,0.14,0.29,0.325],'fontname','Times New Roman');
set(gcf,'currentaxes',ha5);
m_proj('Equidistant Cylindrical','lon',[0 360],'lat',[-80 90]);
m_contourf(Xe,Ye,MMMe,[0:365],'linestyle','none')
m_grid('linest','none','xticklabels',[],'yticklabels',[-60 -30 0 30 60 90],'fontsize',fs,'fontname','Times New Roman');
m_coast('patch',[.8 .8 .8]);
colormap(ha5,sunshine_9lev_2/255)
caxis([0 365]);
hc=colorbar('horizontal');
set(hc,'position',[0.045,.11,0.442,0.015],'Ticks',[0 90 180 270 365],'fontname','Times New Roman','fontsize',fs)
title('(e) THE [2071-2100]','fontsize',fs,'fontname','Times New Roman')

% (f) Arctic THE
ha6=axes('position',[0.347,0.14,0.138,0.327],'fontname','Times New Roman');
set(gcf,'currentaxes',ha6);
m_proj('stereographic','lat',90,'long',0,'radius',35,'rectbox','on');       
m_contourf(lon,lat,MMMe1,[0:365],'linestyle','none')
m_grid('linest',':','xticklabels',[],'ytick',[70 80],'yticklabels',[]);
m_coast('patch',[.8 .8 .8]);
colormap(ha6,sunshine_9lev_2/255)
caxis([0 365]);
hc=colorbar('horizontal');
set(hc,'position',[0.045,.11,0.442,0.015],'Ticks',[0 90 180 270 365],'fontname','Times New Roman','fontsize',fs)
title('(f) THE [2071-2100]','fontsize',fs,'fontname','Times New Roman')
text(-1.83,-0.77,'Annual total days under SSP585 (days)','fontsize',fs,'fontname','Times New Roman')



% (c) Global MHW change
ha3=axes('position',[0.545,0.64,0.29,0.325],'fontname','Times New Roman');
set(gcf,'currentaxes',ha3);
m_proj('Equidistant Cylindrical','lon',[0 360],'lat',[-80 90]);
m_contourf(Xa,Ya,MMMc,[-30:30],'linestyle','none')
m_grid('linest','none','xticklabels',[],'yticklabels',[-60 -30 0 30 60 90],'fontsize',fs,'fontname','Times New Roman');
m_coast('patch',[.8 .8 .8]);
% colormap(ha3,cmp1/255)
colormap(cmp1/255)
caxis([-30 30]);
hc=colorbar('horizontal');
set(hc,'position',[0.545,.61,0.442,0.015],'Ticks',[-30 -20 -10 0 10 20 30],'fontname','Times New Roman','fontsize',fs)
cbarrow
title('(c) MHW change','fontsize',fs,'fontname','Times New Roman')

% (d) Arctic MHW change
ha4=axes('position',[0.83,0.64,0.17,0.334],'fontname','Times New Roman');
set(gcf,'currentaxes',ha4);
m_proj('stereographic','lat',90,'long',0,'radius',35,'rectbox','on');       
m_contourf(Xa,Ya,MMMc,[-30:30],'linestyle','none')
m_grid('linest',':','xticklabels',[],'ytick',[70 80],'yticklabels',[]);
m_coast('patch',[.8 .8 .8]);
colormap(ha4,cmp1/255)
caxis([-30 30]);
hc=colorbar('horizontal');
set(hc,'position',[0.545,.61,0.442,0.015],'Ticks',[-30 -20 -10 0 10 20 30],'fontname','Times New Roman','fontsize',fs)
cbarrow
title('(d) MHW change','fontsize',fs,'fontname','Times New Roman')
text(-2,-0.76,'Annual total days change under SSP585 (days)','fontsize',fs,'fontname','Times New Roman')

% (g) Global THE change
ha7=axes('position',[0.545,0.14,0.29,0.325],'fontname','Times New Roman');
set(gcf,'currentaxes',ha7);
m_proj('Equidistant Cylindrical','lon',[0 360],'lat',[-80 90]);
m_contourf(Xe,Ye,MMMg,[-365:10:365],'linestyle','none')
m_grid('linest','none','xticklabels',[],'yticklabels',[-60 -30 0 30 60 90],'fontsize',fs,'fontname','Times New Roman');
m_coast('patch',[.8 .8 .8]);
colormap(ha7,cmp1/255)
caxis([-365 365]);
hc=colorbar('horizontal');
set(hc,'position',[0.545,.11,0.442,0.015],'Ticks',[-365 -270 -180 -90 0 90 180 270 365],'fontname','Times New Roman','fontsize',fs)
title('(g) THE change','fontsize',fs,'fontname','Times New Roman')

% (h) Arctic THE change
ha8=axes('position',[0.847,0.14,0.138,0.327],'fontname','Times New Roman');
set(gcf,'currentaxes',ha8);
m_proj('stereographic','lat',90,'long',0,'radius',35,'rectbox','on');       
m_contourf(lon,lat,MMMg1,[-365:10:365],'linestyle','none')
m_grid('linest',':','xticklabels',[],'ytick',[70 80],'yticklabels',[]);
m_coast('patch',[.8 .8 .8]);
colormap(ha8,cmp1/255)
caxis([-365 365]);
hc=colorbar('horizontal');
set(hc,'position',[0.545,.11,0.442,0.015],'Ticks',[-365 -270 -180 -90 0 90 180 270 365],'fontname','Times New Roman','fontsize',fs)
title('(h) THE change','fontsize',fs,'fontname','Times New Roman')
text(-2,-0.77,'Annual total days change under SSP585 (days)','fontsize',fs,'fontname','Times New Roman')


colormap(ha1,sunshine_9lev_2/255)
colormap(ha2,sunshine_9lev_2/255)
colormap(ha5,sunshine_9lev_2/255)
colormap(ha6,sunshine_9lev_2/255)

 print(gcf,'-dpdf','-r600','D:\data_code_figures\figures\Figure3.pdf')