clc 
clear
close all


figure (1)

for deal_year = 2018:2021
    
load(['.\dataset\monthly_average\' num2str(deal_year)])

x_time = datenum(char(pairs.tweek.UTCTIME));
start_time = [num2str(deal_year) '-01-01 00:00:00'];
end_time = [num2str(deal_year+1) '-01-01 00:00:00'];

    if deal_year == 2018
        errorbar([pairs.year.time]-datenum(start_time), [pairs.year.h_Mid], [pairs.year.h_err],'-o','color',[1 0 0],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
    elseif deal_year == 2019
        errorbar([pairs.year.time]-datenum(start_time), [pairs.year.h_Mid], [pairs.year.h_err],'-o','color',[0 1 0],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
    elseif deal_year == 2020
        errorbar([pairs.year.time]-datenum(start_time), [pairs.year.h_Mid], [pairs.year.h_err],'-o','color',[0 0 1],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
    else
        errorbar([pairs.year.time]-datenum(start_time), [pairs.year.h_Mid], [pairs.year.h_err],'-o','color',[1 0.7 0],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
    end


    hold on

end

%% 字体大小
figure_FontSize = 30;

set(gcf,'OuterPosition', [-7,33,1936,1056])
set(gca,'Position', [.20 .20 .60 .70]);

set(gca,'XLim',[0 366]);
set(gca,'XTick',[0 31 60 91 121 152 182 213 244 274 305 335]);
set(gca,'XTickLabel',{'        Jan' '        Feb' '        Mar' '        Apr' '        May' '        Jun' '        Jul' '         Aug' '         Sep' '         Oct' '         Nov' '         Dec'});
set(gca,'xminortick','on');
bx = gca;
bx.XAxis.MinorTickValues = [0 31 60 91 121 152 182 213 244 274 305 335];

set(gca, 'YLim', [8e4 10e4] );
set(gca, 'YTick', [8e4 ,8.5e4 ,9e4 ,9.5e4 ,10e4]);
set(gca,'YTickLabel',{80:5:100});
set(gca,'Linewidth',2);
set(gca,'yminortick','on');
bx = gca;
bx.YAxis.MinorTickValues = 8e4:0.1e4:10e4;
ylabel('Altitude(km)')

set(gca,'Linewidth',2);
set(findobj('FontSize',10),'FontSize',figure_FontSize);
set(gca,'TickLength', [0.025 0.0125]);
box on

grid on
grid minor






figure (2)

for deal_year = 2018:2021
    
load(['.\dataset\monthly_average\' num2str(deal_year)])

x_time = datenum(char(pairs.tweek.UTCTIME));
start_time = [num2str(deal_year) '-01-01 00:00:00'];
end_time = [num2str(deal_year+1) '-01-01 00:00:00'];

    if deal_year == 2018
        errorbar([pairs.year.time]-datenum(start_time), [pairs.year.Ne_Mid], [pairs.year.Ne_err],'-o','color',[1 0 0],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
    elseif deal_year == 2019
        errorbar([pairs.year.time]-datenum(start_time), [pairs.year.Ne_Mid], [pairs.year.Ne_err],'-o','color',[0 1 0],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
    elseif deal_year == 2020
        errorbar([pairs.year.time]-datenum(start_time), [pairs.year.Ne_Mid], [pairs.year.Ne_err],'-o','color',[0 0 1],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
    else
        errorbar([pairs.year.time]-datenum(start_time), [pairs.year.Ne_Mid], [pairs.year.Ne_err],'-o','color',[1 0.7 0],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
    end


    hold on

end

%% 字体大小
figure_FontSize = 30;

set(gcf,'OuterPosition', [-7,33,1936,1056])
set(gca,'Position', [.20 .20 .60 .70]);

set(gca,'XLim',[0 366]);
set(gca,'XTick',[0 31 60 91 121 152 182 213 244 274 305 335]);
set(gca,'XTickLabel',{'        Jan' '        Feb' '        Mar' '        Apr' '        May' '        Jun' '        Jul' '         Aug' '         Sep' '         Oct' '         Nov' '         Dec'});
set(gca,'xminortick','on');
bx = gca;
bx.XAxis.MinorTickValues = [0 31 60 91 121 152 182 213 244 274 305 335];

set(gca, 'YLim', [20 32]);
set(gca, 'YTick', [20:5:30]);
set(gca,'YTickLabel',{20:5:32});
set(gca,'Linewidth',2);
set(gca,'yminortick','on');
by = gca;
by.YAxis.MinorTickValues = 20:32;
ylabel('Electron Density(el/cm^3)')


set(gca,'Linewidth',2);
set(findobj('FontSize',10),'FontSize',figure_FontSize);
set(gca,'TickLength', [0.025 0.0125]);
box on

grid on
grid minor