clear
load SFigure7_data.mat

fs=10;

close all
figure
set(gcf,'unit','centimeters','position',[10,5,20,9])

% (a) Global MHW Mean frequency [2071-2100]
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:0.15:3],'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)
caxis([0 3]); 
hc=colorbar('horizontal');
set(hc,'position',[0.045,.61,0.442,0.015],'Ticks',[0 0.6 1.2 1.8 2.4 3],'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(Xa,Ya,MMMa,[0:0.1:3],'linestyle','none')
m_grid('linest',':','xticklabels',[],'ytick',[70 80],'yticklabels',[]);
m_coast('patch',[.8 .8 .8]);
colormap(sunshine_9lev_2/255)
caxis([0 3]); 
hc=colorbar('horizontal');
set(hc,'position',[0.045,.61,0.442,0.015],'Ticks',[0 0.6 1.2 1.8 2.4 3],'fontname','Times New Roman','fontsize',fs)
cbarrow('right')
title('(b) MHW [2071-2100]','fontsize',fs,'fontname','Times New Roman')
text(-1.9,-0.76,'Mean frequency under SSP585 (times)','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:0.1:3],'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)
caxis([0 3]);
hc=colorbar('horizontal');
set(hc,'position',[0.045,.11,0.442,0.015],'Ticks',[0 0.6 1.2 1.8 2.4 3],'fontname','Times New Roman','fontsize',fs)
cbarrow('right')
title('(e) THE [2071-2100]','fontsize',fs,'fontname','Times New Roman')

% (f) Arctic THE
ha6=axes('position',[0.33,0.14,0.17,0.334],'fontname','Times New Roman');
set(gcf,'currentaxes',ha6);
m_proj('stereographic','lat',90,'long',0,'radius',35,'rectbox','on');       
m_contourf(lon,lat,MMMf,[0:0.1:3],'linestyle','none')
m_grid('linest',':','xticklabels',[],'ytick',[70 80],'yticklabels',[]);
m_coast('patch',[.8 .8 .8]);
colormap(sunshine_9lev_2/255)
caxis([0 3]);
hc=colorbar('horizontal');
set(hc,'position',[0.045,.11,0.442,0.015],'Ticks',[0 0.6 1.2 1.8 2.4 3],'fontname','Times New Roman','fontsize',fs)
cbarrow('right')
title('(f) THE [2071-2100]','fontsize',fs,'fontname','Times New Roman')
text(-1.9,-0.76,'Mean frequency under SSP585 (times)','fontsize',fs,'fontname','Times New Roman')

% (c)
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(Xc,Yc,MMMc,[-3:0.1:3],'linestyle','none')
m_grid('linest','none','xticklabels',[],'yticklabels',[-60 -30 0 30 60 90],'fontsize',fs);
m_coast('patch',[.8 .8 .8]);
colormap(cmp1/255)
caxis([-3 3]);
hc=colorbar('horizontal');
set(hc,'position',[0.545,.61,0.442,0.015],'Ticks',[-3 -2 -1 0 1 2 3],'fontname','Times New Roman','fontsize',fs)
cbarrow
title('(c) MHW change','fontsize',fs,'fontname','Times New Roman')

% (d)
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(Xc,Yc,MMMc,[-3:0.1:3],'linestyle','none')
m_grid('linest',':','xticklabels',[],'ytick',[70 80],'yticklabels',[]);
m_coast('patch',[.8 .8 .8]);
colormap(cmp1/255)
caxis([-3 3]);
hc=colorbar('horizontal');
set(hc,'position',[0.545,.61,0.442,0.015],'Ticks',[-3 -2 -1 0 1 2 3],'fontname','Times New Roman','fontsize',fs)
cbarrow
title('(d) MHW change','fontsize',fs,'fontname','Times New Roman')
text(-2.05,-0.76,'Mean frequency change under SSP585 (times)','fontsize',fs,'fontname','Times New Roman')

% (g)
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(Xg,Yg,MMMg,[-3:0.1:3],'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(cmp1/255)
caxis([-3 3]);
hc=colorbar('horizontal');
set(hc,'position',[0.545,.11,0.442,0.015],'Ticks',[-3 -2 -1 0 1 2 3],'fontname','Times New Roman','fontsize',fs)
cbarrow
title('(g) THE change','fontsize',fs,'fontname','Times New Roman')

% (h)
ha8=axes('position',[0.83,0.14,0.17,0.334],'fontname','Times New Roman');
set(gcf,'currentaxes',ha8);
m_proj('stereographic','lat',90,'long',0,'radius',35,'rectbox','on');       
m_contourf(Xh,Yh,MMMh,[-3:0.1:3],'linestyle','none')
m_grid('linest',':','xticklabels',[],'ytick',[70 80],'yticklabels',[]);
m_coast('patch',[.8 .8 .8]);
colormap(cmp1/255)
caxis([-3 3]);
hc=colorbar('horizontal');
set(hc,'position',[0.545,.11,0.442,0.015],'Ticks',[-3 -2 -1 0 1 2 3],'fontname','Times New Roman','fontsize',fs)
cbarrow
title('(h) THE change','fontsize',fs,'fontname','Times New Roman')
text(-2.05,-0.76,'Mean frequency change under SSP585 (times)','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,'-dpng','-r600','D:\data_code_figures\SFigures\SFigure7.png')