clear

load('SFigure5_data.mat')
fs=8;

close all

figure
set(gcf,'unit','centimeters','position',[15,5,20,6])

% SSP126

% (a) Arctic
ha1=axes('position',[0.06,0.6,0.21,0.36],'fontsize',fs,'fontname','Times New Roman');
set(gcf,'currentaxes',ha1)
myc=repmat(cmp1(end-4,:)./255,12,1);
h = boxplot(a_126,'colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1); 
ylabel('Days','fontsize',fs,'fontname','Times New Roman');
title('(a) SSP126','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','fontname','Times New Roman')
ylim([-5 30])
set(gca,'xtick',[1:12],'xticklabel',[])
set(gca,'ytick',[-5,0:10:30],'yticklabel',{-5,0:10:30})

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

% (e) Global
ha1=axes('position',[0.06,0.05,0.21,0.43],'fontsize',fs,'fontname','Times New Roman');
set(gcf,'currentaxes',ha1)
myc=repmat(cmp1(4,:)./255,12,1);
h = boxplot(g_126,'colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1); 
ylabel('Days','fontsize',fs,'fontname','Times New Roman');
title('(e) SSP126','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','fontname','Times New Roman')
ylim([-5 30])
set(gca,'ytick',[-5,0:10:30],'yticklabel',{-5,0:10:30})
set(gca,'xtick',[1:12],'xticklabel',{'J','F','M','A','M','J','J','A','S','O','N','D'})
xlabel('Month','fontsize',fs,'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
% (b) Arctic
ha2=axes('position',[0.29,0.6,0.2,0.36],'fontsize',fs,'fontname','Times New Roman');
set(gcf,'currentaxes',ha2)
myc=repmat(cmp1(end-4,:)./255,12,1);
h = boxplot(a_245,'colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1); 
title('(b) SSP245','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','fontname','Times New Roman')
ylim([-5 30])
set(gca,'xtick',[1:12],'xticklabel',[])
set(gca,'ytick',[-5,0:10:30],'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

% (f) Global
ha2=axes('position',[0.29,0.05,0.2,0.43],'fontsize',fs,'fontname','Times New Roman');
set(gcf,'currentaxes',ha2)
myc=repmat(cmp1(4,:)./255,12,1);
h = boxplot(g_245,'colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1); 
title('(f) SSP245','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','fontname','Times New Roman')
ylim([-5 30])
set(gca,'xtick',[1:12],'xticklabel',{'J','F','M','A','M','J','J','A','S','O','N','D'})
set(gca,'ytick',[-5,0:10:30],'yticklabel',[])
xlabel('Month','fontsize',fs,'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

% SSP370
% (c) Arctic
ha3=axes('position',[0.507,0.6,0.2,0.36],'fontsize',fs,'fontname','Times New Roman');
set(gcf,'currentaxes',ha3)
myc=repmat(cmp1(end-4,:)./255,12,1);
h = boxplot(a_370,'colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1); 
title('(c) SSP370','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','fontname','Times New Roman')
ylim([-5 30])
set(gca,'xtick',[1:12],'xticklabel',[])
set(gca,'ytick',[-5,0:10:30],'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

% (g) Global
ha3=axes('position',[0.507,0.05,0.2,0.43],'fontsize',fs,'fontname','Times New Roman');
set(gcf,'currentaxes',ha3)
myc=repmat(cmp1(4,:)./255,12,1);
h = boxplot(g_370,'colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1); 
title('(g) SSP370','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','fontname','Times New Roman')
ylim([-5 30])
set(gca,'xtick',[1:12],'xticklabel',{'J','F','M','A','M','J','J','A','S','O','N','D'})
set(gca,'ytick',[-5,0:10:30],'yticklabel',[])
xlabel('Month','fontsize',fs,'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

% SSP585
% (d) Arctic
ha4=axes('position',[0.724,0.6,0.205,0.36],'fontsize',fs,'fontname','Times New Roman');
set(gcf,'currentaxes',ha4)
myc=repmat(cmp1(end-4,:)./255,12,1);
h = boxplot(a_585,'colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1); 
title('(d) SSP585','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','fontname','Times New Roman')
ylim([-5 30])
set(gca,'xtick',[1:12],'xticklabel',[])
set(gca,'ytick',[-5,0:10:30],'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

% (h) Global
ha4=axes('position',[0.724,0.05,0.205,0.43],'fontsize',fs,'fontname','Times New Roman');
set(gcf,'currentaxes',ha4)
myc=repmat(cmp1(4,:)./255,12,1);
h = boxplot(g_585,'colors',myc,'Symbol','+k','widths',0.3);
set(h,'Linewidth',1); 
title('(h) SSP585','fontsize',fs,'fontname','Times New Roman');
set(gca,'fontsize',fs,'tickdir','out','fontname','Times New Roman')
ylim([-5 30])
set(gca,'xtick',[1:12],'xticklabel',{'J','F','M','A','M','J','J','A','S','O','N','D'})
set(gca,'ytick',[-5,0:10:30],'yticklabel',[])
xlabel('Month','fontsize',fs,'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


print(gcf,'-dpng','-r600','D:\data_code_figures\SFigures\SFigure5.png')