clear all

filename0 = 'Fig09' 

load Fig09_Pabs an0 ne0 SOL SOLs
 

%%

for ii=1:10

    SOL5(ii) =  interp1(an0,SOL(:,ii),5,'spline');

end


%%

hh=figure(1);
hh.Position = [1600 100 700 500];
set(gcf,'color','w');

load('ehtable','whitejet','greyjet','redblue', 'color7');
set(groot,'defaultAxesColorOrder',color7)
myblue = color7;


%% 
subplot(221)

contourf(an0, ne0/10, SOL'*100,32,'linestyle','none');
h=colorbar;
hold on
    plot([0, 0], [0.5,5],'k--')
    plot([-11,11],[2.2 2.2],'w:')
hold off
colormap(greyjet)
ylabel('n_{ant} (x 10^{18} m^{-3})','fontsize', 15)
xlabel('\Delta \phi (degrees)','fontsize', 15) 
set(gca, 'clim', [1,60], 'ylim', [0.25,5.25])
set(gca, 'fontsize', 15)
set(gca, 'position', [0.1, 0.6, 0.39, 0.3])
set(h,'location','northoutside')
text(-10.7, 4.5, '(a)', 'fontsize', 24)
text(-8, 4.3, 'P_{abs} (%)', 'fontsize', 20)
  

%%
subplot(223)
kk1 = [2 5 8]; 

plot(an0(1),SOL(1,kk1(1))*100, 'o-', 'color', myblue(2,:), 'linewidth', 1)
hold on
    plot(an0(1),SOL(1,kk1(2))*100, 'o-', 'color', myblue(3,:), 'linewidth', 1)
    plot(an0(1),SOL(1,kk1(3))*100, 'o-', 'color', myblue(4,:), 'linewidth', 1)
    plot([0, 0], [0,40],'k:')
    plot(an0,SOL(:,kk1(1))*100, 'o-', 'color', myblue(2,:), 'linewidth', 1); 
    plot(an0,SOL(:,kk1(2))*100, 'o-', 'color', myblue(3,:), 'linewidth', 1); 
    plot(an0,SOL(:,kk1(3))*100, 'o-', 'color', myblue(4,:), 'linewidth', 1); 
    hold off
h=legend('n_{ant} = 1.0 x 10^{18}', 'n_{ant} = 2.5 x 10^{18}','n_{ant} = 4.0 x 10^{18}');
set(h, 'location', 'north', 'box','off', 'fontsize', 14)
xlabel('\Delta \phi (degrees)','fontsize', 15)
ylabel('P_{abs} (%)','fontsize', 15)
set(gca, 'ylim', [0,65])
set(gca, 'fontsize', 15)
set(gca, 'position', [0.1, 0.12, 0.39, 0.35])
text(-10.7, 59, '(b)', 'fontsize', 24)
 
    
%%
subplot(222)

kk1 = [6 8 9 10 11];  

plot(ne0(1)/10,SOL(kk1(5),1)*100, 'o-', 'color', myblue(6,:), 'linewidth', 1)
hold on
    plot(ne0(1)/10,SOL(kk1(4),1)*100, 'o-', 'color', myblue(5,:), 'linewidth', 1)
    plot(ne0(1)/10,SOL5(1)*100,  '*-', 'color', myblue(4,:), 'linewidth', 1)
    plot(ne0(1)/10,SOL(kk1(3),1)*100, 'o-', 'color', myblue(4,:), 'linewidth', 1)
    plot(ne0(1)/10,SOL(kk1(2),1)*100, 'o-', 'color', myblue(3,:), 'linewidth', 1)
    plot(ne0(1)/10,SOL(kk1(1),1)*100, 'o-', 'color', myblue(2,:), 'linewidth', 1)
    plot(ne0/10,SOL(kk1(5),:)*100, 'o-', 'color', myblue(6,:), 'linewidth', 1);%, ne1, SOL2D01(kk2(1),:)*100,'b--')
    plot(ne0/10,SOL(kk1(4),:)*100, 'o-', 'color', myblue(5,:), 'linewidth', 1);%, ne1, SOL2D01(kk2(2),:)*100,'r--')
    plot(ne0/10,SOL5*100, '*-', 'color', myblue(4,:), 'linewidth', 1)
    plot(ne0/10,SOL(kk1(3),:)*100, 'o-', 'color', myblue(3,:), 'linewidth', 1);%, ne1, SOL2D01(kk2(3),:)*100,'m--')
    plot(ne0/10,SOL(kk1(2),:)*100, 'o-', 'color', myblue(2,:), 'linewidth', 1);%, ne1, SOL2D01(kk2(4),:)*100,'g--')
    plot(ne0/10,SOL(kk1(1),:)*100, 'o-', 'color', myblue(1,:), 'linewidth', 1);%, ne1, SOL2D01(kk2(4),:)*100,'g--')
    plot([2.2 2.2], [0,80],'k:')
hold off
 
xlabel('n_{ant} (x 10^{18} m^{-3})','fontsize', 15)
ylabel('P_{abs} (%)','fontsize', 15) 
h=legend('\Delta \phi = 11.5^{o}', '\Delta \phi = 8.5^{o}', '\Delta \phi = 5^{o}',  '\Delta \phi = 2.5^{o}', '\Delta \phi = 1.5^{o}', '\Delta \phi = 0^{o}');
set(h, 'location', 'northeast', 'box','off', 'fontsize', 12)
set(gca, 'fontsize', 15)
set(gca, 'position', [0.59, 0.6, 0.39, 0.35])
set(gca, 'xlim', [0, 6])
text(0.2,  73, '(c)', 'fontsize', 24)


%% 

subplot(224)

kk1 = [6 8 9 10 11]; 
kk2 = [45 47 49 53 57]; 
 
plot(ne0(1)/10,SOLs(kk1(5),1)*100, 'o-', 'color', myblue(6,:), 'linewidth', 1)
hold on
    plot(ne0(1)/10,SOLs(kk1(4),1)*100, 'o-', 'color', myblue(5,:), 'linewidth', 1)
    plot(ne0(1)/10,SOL5(1)*100-SOL(kk1(1),1)*100,  '*-', 'color', myblue(4,:), 'linewidth', 1)
    plot(ne0(1)/10,SOLs(kk1(3),1)*100, 'o-', 'color', myblue(3,:), 'linewidth', 1)
    plot(ne0(1)/10,SOLs(kk1(2),1)*100, 'o-', 'color', myblue(2,:), 'linewidth', 1)
    plot(ne0/10,SOLs(kk1(2),:)*100, 'o-', 'color', myblue(2,:), 'linewidth', 1);%, ne1, SOL2D01(kk2(2),:)*100,'r--')
    plot(ne0/10,SOLs(kk1(3),:)*100, 'o-', 'color', myblue(3,:), 'linewidth', 1);%, ne1, SOL2D01(kk2(3),:)*100,'m--')
    plot(ne0/10,SOL5*100-SOL(kk1(1),:)*100, '*-', 'color', myblue(4,:), 'linewidth', 1)
    plot(ne0/10,SOLs(kk1(4),:)*100, 'o-', 'color', myblue(5,:), 'linewidth', 1);%, ne1, SOL2D01(kk2(4),:)*100,'g--')
    plot(ne0/10,SOLs(kk1(5),:)*100, 'o-', 'color', myblue(6,:), 'linewidth', 1);%, ne1, SOL2D01(kk2(4),:)*100,'g--')
    plot([2.2 2.2], [-5,80],'k:')
hold off
 
xlabel('n_{ant} (x 10^{18} m^{-3})','fontsize', 15)
ylabel('P_{abs SW} (%)','fontsize', 15) 
h=legend('\Delta \phi = 11.5^{o}', '\Delta \phi = 8.5^{o}', '\Delta \phi = 5^{o}', '\Delta \phi = 2.5^{o}', '\Delta \phi = 1.5^{o}');
set(h, 'location', 'northeast', 'box','off', 'fontsize', 12)
set(gca, 'fontsize', 15)
set(gca, 'position', [0.59, 0.12, 0.39, 0.35])
set(gca, 'ylim', [-5, 55])
set(gca, 'xlim', [0, 6])
text(0.2, 50, '(d)', 'fontsize', 24) 


%%

% saveas(gca, filename0,'epsc')
saveas(gca, filename0,'png')



