function PlotCalibrationDays(x, y, y_SE, y_fit, i)
% PlotCalibrationDays(x, y, y_SE, y_fit, y_fit, i)
% Calibration figure plotting using data of June 5, 6 and 7, 2015, for the
% i^{th} bin. Figures stored in \Figures

%--- define color map ---
colormap = {[0.6,0,1],[1,0,0],[0.2,0.4,1],[0,0.4,0],[0.6,0.4,0.4]}; % purple, red, baby blue, dark green, brown       
%--- define axis ---
axisset = {[10^5.8,10^6.8],[10^5.4,10^6.5],[10^5.1,10^6.3],[10^4.7,10^5.8],[10^4.2,10^5.4],[10^3,10^4.8],[10^1.4,10^4.2]}; % for each of the 7 bins

for j = 1:5
        plot_x = x.(['D',num2str(j)]).(['n',num2str(i)]);
        plot_y = y(:,i);
        plot_y_err = y_SE(:,i);
        plot_y_fit = y_fit.(['D',num2str(j)]).(['n',num2str(i)]).y_fit;
        plot_y_err_fit = y_fit.(['D',num2str(j)]).(['n',num2str(i)]).y_err_fit;
        plot_y_fit_dn = plot_y_fit - plot_y_err_fit;
        plot_y_fit_up = plot_y_fit + plot_y_err_fit;
        
        %--- plot measurement of each OPC ---
        plot(plot_x,plot_y,'o','MarkerFaceColor','None','MarkerEdgeColor',colormap{j},'MarkerSize',4); hold on;
        for k = 1:length(plot_x)
            temp_x = [plot_x(k),plot_x(k)];
            temp_y = [plot_y(k)-plot_y_err(k), plot_y(k)+plot_y_err(k)]; % 95% confidence level
            plot(temp_x,temp_y,'-','color',colormap{j}); hold on;
        end
        %--- plot powerfit line ---
        plot(plot_x,plot_y_fit,'-','color',colormap{j}); hold on;
        plot(plot_x,plot_y_fit_dn,':','color',colormap{j}); hold on;
        plot(plot_x,plot_y_fit_up,':','color',colormap{j}); hold on; 
end
    %--- define 1:1 reference line ---
    xx = linspace(axisset{i}(1),axisset{i}(2),100);
    plot(xx,xx,'k-.','LineWidth',1.5); hold on;
    
    %--- plot setting ---
    set(gca,'xscale','log');
    set(gca,'yscale','log');
    xlim([axisset{i}(1),axisset{i}(2)]);
    ylim([axisset{i}(1),axisset{i}(2)]);
    xlabel('Uncalibrated aerosol number concentration \itx\rm\bf, #/m^{3}','FontSize',12,'FontWeight','bold');
    ylabel('Calibrated aerosol number concentration \ity\rm\bf, #/m^{3}','FontSize',12,'FontWeight','bold');
    title(['Bin - ',num2str(i)],'FontSize',12,'FontWeight','bold');   
    
    %--- add legend ---
    plot_x1 = x.D1.(['n',num2str(i)])(1);
    plot_x2 = x.D2.(['n',num2str(i)])(1);
    plot_x3 = x.D3.(['n',num2str(i)])(1);
    plot_x4 = x.D4.(['n',num2str(i)])(1);
    plot_x5 = x.D5.(['n',num2str(i)])(1);
    plot_y1 = y(1,i);
    line_D1 = plot(plot_x1, plot_y1,'o','MarkerFaceColor','None','MarkerEdgeColor',colormap{1},'MarkerSize',4); hold on;    
    line_D2 = plot(plot_x2, plot_y1,'o','MarkerFaceColor','None','MarkerEdgeColor',colormap{2},'MarkerSize',4); hold on;    
    line_D3 = plot(plot_x3, plot_y1,'o','MarkerFaceColor','None','MarkerEdgeColor',colormap{3},'MarkerSize',4); hold on;    
    line_D4 = plot(plot_x4, plot_y1,'o','MarkerFaceColor','None','MarkerEdgeColor',colormap{4},'MarkerSize',4); hold on;    
    line_D5 = plot(plot_x5, plot_y1,'o','MarkerFaceColor','None','MarkerEdgeColor',colormap{5},'MarkerSize',4); hold on;    
    
    thelegend = legend([line_D1 line_D2 line_D3 line_D4 line_D5],{'OPC 9284',...
        'OPC 9290','OPC 9281','OPC 9278','OPC 9287'});
    set(thelegend,'location','northwest','FontSize',9,'FontWeight','bold');
    
% display(['%--- function PlotCalibrationDays(Bin_',num2str(i),') complete ----%']);
end