clear
load SFigure13_data.mat

fs=12;

close all
figure
set(gcf,'unit','centimeters','position',[10,5,16,14])

subplot(2,1,1)
h = boxplot(a_MHW,'colors',myc,'Symbol','+k','widths',0.8);
set(h,'Linewidth',1.5);
set(gca,'xtick',[3.5,9.5,15.5,21.5],'xticklabel',[])
set(gca,'fontsize',fs,'tickdir','out','fontname','Times New Roman')
ylabel('days','fontsize',fs,'fontname','Times New Roman');
title('(a) MHW mean duration change','fontsize',fs,'fontname','Times New Roman');
ylim([-10 20])
set(gca,'ytick',-10:10:20,'yticklabel',{-10:10:20},'fontname','Times New Roman')
text(1,17,'Arctic Ocean','fontsize',16,'color',cmp1(end-4,:)./255,'fontname','Times New Roman')
text(1,14,'Global Ocean','fontsize',16,'color',cmp1(4,:)./255,'fontname','Times New Roman')
grid on
boxobj=findobj(gca,'Tag','Box');
LW=findobj(gca,'Tag','Lower Whisker');
UW=findobj(gca,'Tag','Upper Whisker');
for j=1:length(boxobj)
   LW(j).LineStyle='-'; 
   UW(j).LineStyle='-'; 
end

subplot(2,1,2)
h = boxplot(b_THE,'colors',myc,'Symbol','+k','widths',0.8);
set(h,'Linewidth',1.5);
set(gca,'xtick',[3.5,9.5,15.5,21.5],'xticklabel',{'SSP126','SSP245','SSP370','SSP585'},'fontname','Times New Roman')
set(gca,'fontsize',fs,'tickdir','out')
ylabel('days','fontsize',fs,'fontname','Times New Roman');
title('(b) THE mean duration change','fontsize',fs,'fontname','Times New Roman');
ylim([-500 7500])
set(gca,'ytick',[0,1500:2000:7500],'yticklabel',{0,1500:2000:7500},'fontname','Times New Roman');
text(1,6700,'Arctic Ocean','fontsize',16,'color',cmp1(end-4,:)./255,'fontname','Times New Roman')
text(1,5900,'Global Ocean','fontsize',16,'color',cmp1(4,:)./255,'fontname','Times New Roman')
grid on
boxobj=findobj(gca,'Tag','Box');
LW=findobj(gca,'Tag','Lower Whisker');
UW=findobj(gca,'Tag','Upper Whisker');
for j=1:length(boxobj)
   LW(j).LineStyle='-'; 
   UW(j).LineStyle='-'; 
end

print(gcf,'-dpng','-r600','D:\data_code_figures\SFigures\SFigure13.png')