clear
load SFigure12_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('times','fontsize',fs,'fontname','Times New Roman');
title('(a) MHW mean frequency change','fontsize',fs,'fontname','Times New Roman');
ylim([-0.2 1])
set(gca,'ytick',-0.2:0.2:1,'yticklabel',{-0.2:0.2:1},'fontname','Times New Roman')
text(1,0.9,'Arctic Ocean','fontsize',fs,'color',cmp1(end-4,:)./255,'fontname','Times New Roman');
text(1,0.77,'Global Ocean','fontsize',fs,'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('times','fontsize',fs,'fontname','Times New Roman');
title('(b) THE mean frequency change','fontsize',fs,'fontname','Times New Roman');
ylim([-1.5 2.5])
set(gca,'ytick',-1.5:0.5:2.5,'yticklabel',{-1.5:0.5:2.5},'fontname','Times New Roman')
text(18,2.2,'Arctic Ocean','fontsize',fs,'color',cmp1(end-4,:)./255,'fontname','Times New Roman');
text(18,1.7,'Global Ocean','fontsize',fs,'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\SFigure12.png')