%---------plot figure6---------------
clc,clear,close all

load('./fig6.mat')

%% plot
month_name = {'Jan.','Feb.','Mar.','Apr.','May','Jun.',...
    'Jul.','Aug.','Sep.','Oct.','Nov.','Dec.'};

figure('color','w')
set(gcf,'position',[100,70,1400,700])

for m=1:12
    subplot(3,4,m)
    
    fc1_monthly_mean_2018 = fc1_monthly_mean(1,m,:);
    fc1_monthly_mean_2019 = fc1_monthly_mean(2,m,:);
    fc1_monthly_mean_2020 = fc1_monthly_mean(3,m,:);
    fc1_monthly_mean_2021 = fc1_monthly_mean(4,m,:);
    
    fc1_std_2018 = fc1_std(1,m,:);
    fc1_std_2019 = fc1_std(2,m,:);
    fc1_std_2020 = fc1_std(3,m,:);
    fc1_std_2021 = fc1_std(4,m,:);
    
    hold on
    
    plot(fc1_monthly_mean_2018(:),'ro-','MarkerSize',5);
    plot(fc1_monthly_mean_2019(:),'bo-','MarkerSize',5);
    plot(fc1_monthly_mean_2020(:),'o-','color',[0.4660 0.6740 0.1880],'MarkerSize',5);
    plot(fc1_monthly_mean_2021(:),'o-','color',[0.9290 0.6940 0.1250],'MarkerSize',5);
    
    errorbar(1:12,fc1_monthly_mean_2018(:),fc1_std_2018(:),'ro-','MarkerSize',5);
    errorbar(1:12,fc1_monthly_mean_2019(:),fc1_std_2019(:),'bo-','MarkerSize',5);
    errorbar(1:12,fc1_monthly_mean_2020(:),fc1_std_2020(:),'o-','color',[0.4660 0.6740 0.1880],'MarkerSize',5);
    errorbar(1:12,fc1_monthly_mean_2021(:),fc1_std_2021(:),'o-','color',[0.9290 0.6940 0.1250],'MarkerSize',5);
    
    hold off
    grid on
    
    xticks(1:2:13);
    xticklabels({'18','20','22',...
                 '00','02','04','06'})
    xlim([0,13])
    ylim([1.55,1.80])
    
    box on
    ax_tmp = gca;
    text(ax_tmp.XLim(1)+0.82*(ax_tmp.XLim(2)-ax_tmp.XLim(1)),...
        ax_tmp.YLim(1)+0.93*(ax_tmp.YLim(2)-ax_tmp.YLim(1)),...
        month_name{m},'FontSize',12)
    text(ax_tmp.XLim(1)+0.02*(ax_tmp.XLim(2)-ax_tmp.XLim(1)),...
        ax_tmp.YLim(1)+0.92*(ax_tmp.YLim(2)-ax_tmp.YLim(1)),...
        ['($',char('a'+m-1),'$)'],'interpreter','latex','fontweight','bold','FontSize',12)
    clear ax_tmp
    
    if m>=9
        xlabel('Local Time (hour)','fontweight','bold','FontSize',12)
    end
    if m==1 || m==5 || m==9
        ylabel('Cutoff Frequency (kHz)','interpreter','none','fontweight','bold','FontSize',11)
    end
    
    set(gca,'Layer','bottom')
    set(gca,'xminortick','on');
    set(gca,'yminortick','on');
end
clear m

legend('2018','2019','2020','2021',...
    'interpreter','latex',...
    'Orientation','horizontal','Box','off',...
    'Location',[0.40,0.00,0.20,0.03],...
    'fontweight','normal','FontSize',12)


