clc     
clear
close all

for deal_month = 1:12
    
    figure()
    for deal_year = 2018:2021
        
        file_name = ['.\dataset\latitude_average\' num2str(deal_year) '\' num2str(deal_year) '_' num2str(deal_month) '.mat'];
        
        if exist(file_name,'file')
            load(file_name)
        else
            continue
        end


        if deal_year == 2018
            errorbar([pairs.latitude.lat_Mid], [pairs.latitude.fh_Mid], [pairs.latitude.fh_err],'-o','color',[1 0 0],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
        elseif deal_year == 2019
            errorbar([pairs.latitude.lat_Mid], [pairs.latitude.fh_Mid], [pairs.latitude.fh_err],'-o','color',[0 1 0],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
        elseif deal_year == 2020
            errorbar([pairs.latitude.lat_Mid], [pairs.latitude.fh_Mid], [pairs.latitude.fh_err],'-o','color',[0 0 1],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
        else
            errorbar([pairs.latitude.lat_Mid], [pairs.latitude.fh_Mid], [pairs.latitude.fh_err],'-o','color',[1 0.7 0],'Linewidth', 3, 'MarkerSize', 20, 'Capsize', 20);
        end


    hold on

    end

    %% 字体大小
    figure_FontSize = 40;

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



    set(gca,'XLim',[-5 50]);
    set(gca,'XTick',[0:10:50]);
    set(gca,'XTickLabel',{'0' '10°N' '20°N' '30°N' '40°N' '50°N'});
    set(gca,'xminortick','on');
    ax = gca;
    ax.XAxis.MinorTickValues = -5:5:50 ;
    xlabel('Magnetic Latitude')

    set(gca, 'YLim', [1.0e6 1.6e6]);
    set(gca, 'YTick', [1.0e6:1e5:1.6e6]);
    set(gca,'YTickLabel',{1.0:0.1:1.6});
    set(gca,'yminortick','on');
    ax = gca;
    ax.YAxis.MinorTickValues = 1.0e6:2e4:1.6e6 ;
    ylabel('f_e (MHz)')

    % legend('2018','2019','2020','2021')
    % legend('location','bestoutside')

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