clear
load SFigure11_data.mat

fs=10;

close all
figure
set(gcf,'unit','centimeters','position',[10,5,16,14])

% SSP126

subplot(2,2,1)

yyaxis right
plot(1:12,sm_126,'linewidth',1.5,'color',cmp1(4,:)./255,'linestyle','-')
hold on
plot(1:12,sm_126,'color',cmp1(4,:)./255,'linestyle','none','marker','.','markersize',18)
ylim([-1.2 3.6])  
xlim([0 13])
set(gca,'fontsize',fs,'tickdir','out','YColor',cmp1(4,:)./255)
set(gca,'ytick',[-1.2:1.2:3.6],'yticklabel',[])

yyaxis left
h = boxplot(mi_126','colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1.5);
title('(a) SSP126','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','YColor',cmp1(end-4,:)./255)
xlim([0 13])
ylim([-1 3])
set(gca,'xtick',[1:12],'xticklabel',[])
set(gca,'ytick',[-1:3],'yticklabel',{-1:3},'fontname','Times New Roman')
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
grid on

% SSP245
subplot(2,2,2)

yyaxis right
plot(1:12,sm_245,'linewidth',1.5,'color',cmp1(4,:)./255,'linestyle','-')
hold on
plot(1:12,sm_245,'color',cmp1(4,:)./255,'linestyle','none','marker','.','markersize',18)
ylim([-1.2 3.6])  
xlim([0 13])
set(gca,'fontsize',fs,'tickdir','out','YColor',cmp1(4,:)./255)
set(gca,'ytick',[-1.2:1.2:3.6],'yticklabel',{-1.2:1.2:3.6},'fontname','Times New Roman')

yyaxis left
h = boxplot(mi_245','colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1.5);
title('(b) SSP245','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','YColor',cmp1(end-4,:)./255)
xlim([0 13])
ylim([-1 3]) 
set(gca,'xtick',[1:12],'xticklabel',[])
set(gca,'ytick',[-1:3],'yticklabel',[]) 
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
grid on


% SSP370
subplot(2,2,3)

yyaxis right
plot(1:12,sm_370,'linewidth',1.5,'color',cmp1(4,:)./255,'linestyle','-')
hold on
plot(1:12,sm_370,'color',cmp1(4,:)./255,'linestyle','none','marker','.','markersize',18)
ylim([-1.2 3.6])  
xlim([0 13])
set(gca,'fontsize',fs,'tickdir','out','YColor',cmp1(4,:)./255)
set(gca,'ytick',[-1.2:1.2:3.6],'yticklabel',[])

yyaxis left
h = boxplot(mi_370','colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1.5);
xlabel('Month','fontsize',fs,'fontname','Times New Roman');
title('(c) SSP370','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','YColor',cmp1(end-4,:)./255,'fontname','Times New Roman')
xlim([0 13])
ylim([-1 3]) 
set(gca,'xtick',[1:12],'xticklabel',{'J','F','M','A','M','J','J','A','S','O','N','D'})
set(gca,'ytick',[-1:3],'yticklabel',{-1:3}) 
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
grid on


% SSP585
subplot(2,2,4)

yyaxis right
plot(1:12,sm_585,'linewidth',1.5,'color',cmp1(4,:)./255,'linestyle','-')
hold on
plot(1:12,sm_585,'color',cmp1(4,:)./255,'linestyle','none','marker','.','markersize',18)
ylim([-1.2 3.6])  
xlim([0 13])
set(gca,'fontsize',fs,'tickdir','out','YColor',cmp1(4,:)./255)
set(gca,'ytick',[-1.2:1.2:3.6],'yticklabel',{-1.2:1.2:3.6},'fontname','Times New Roman')

yyaxis left
h = boxplot(mi_585','colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1.5);
xlabel('Month','fontsize',fs,'fontname','Times New Roman');
title('(d) SSP585','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','YColor',cmp1(end-4,:)./255,'fontname','Times New Roman')
xlim([0 13])
ylim([-1 3]) 
set(gca,'xtick',[1:12],'xticklabel',{'J','F','M','A','M','J','J','A','S','O','N','D'})
set(gca,'ytick',[-1:3],'yticklabel',[]) 
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
grid on

text(-19,1.4, 'MHW mean intensity change (\circC)', 'Rotation', 90,'color',cmp1(end-4,:)./255,'fontname','Times New Roman');
text(15,2, 'SST variance change (\circC)', 'Rotation', 90,'color',cmp1(4,:)./255,'fontname','Times New Roman');


print(gcf,'-dpng','-r600','D:\data_code_figures\SFigures\SFigure11.png')