function plotMeanHemoVar(summit, nonsummit, siRunning, nsiRunning, var, metric, numHours, drop_NS_XI, expDir, expName, mvMean)
    figure;
    hold on; 
    
    colors = matlabColors;

    % Calculate mean/median and SE for summiting group
    if strcmp(metric,'mean')
        sPlot = smoothdata(transpose(nanmean(summit)),'movmean',mvMean);
    elseif strcmp(metric,'median')
        sPlot = smoothdata(transpose(nanmedian(summit)),'movmean',mvMean);
    end
    if find(isnan(sPlot))
        sPlot = sPlot(1:find(isnan(sPlot),1)-1); % plot all values until last non-Nan
    end
    
    sE = smoothdata(transpose(nanstd(summit)./sqrt(siRunning)),'movmean',mvMean);
    sE = sE(1:length(sPlot)); % plot all values until last non-Nan
    %sE2 = smoothdata(transpose(nanstd(summit)),'movmean',mvMean);
    
    % Calculate mean/median and SE for non-summiting group
    if strcmp(metric,'mean')
        nsPlot = smoothdata(transpose(nanmean(nonsummit)),'movmean',mvMean);
    elseif strcmp(metric,'median')
        nsPlot = smoothdata(transpose(nanmedian(nonsummit)),'movmean',mvMean);
    end
    if find(isnan(nsPlot))
        nsPlot = nsPlot(1:find(isnan(nsPlot),1)-1); % plot all values until last non-Nan
    end        
    
    nsE = smoothdata(transpose(nanstd(nonsummit)./sqrt(nsiRunning)),'movmean',mvMean);
    nsE = nsE(1:length(nsPlot)); % plot all values until last non-Nan
    
    % Plot mean/median +/- SE for each group
    
    downF = 10; % factor by which to downsample data
    
    %plotColor = colors{3};
    plotColor = [1 0 0];
    %areaBar(1:length(sPlot),sPlot,sE,plotColor,plotColor,'-',0.1);
    areaBar(downsample(1:length(sPlot),downF),downsample(sPlot,downF),downsample(sE,downF),plotColor,plotColor,'-',0.1);
    
    %plotColor = colors{2};
    plotColor = [0 0 0];
    %areaBar(1:length(nsPlot),nsPlot,nsE,plotColor,plotColor,'-',0.1);
    areaBar(downsample(1:length(nsPlot),downF),downsample(nsPlot,downF),downsample(nsE,downF),plotColor,plotColor,'-',0.1);

    ylabel(strcat(metric,'-',var));
    
    %set(gca,'xtick',0:3600*1.5:length(summit),'xticklabel',0:0.5:length(summit)/(3600*3),'TickLength',[0 0]); %,'Clipping','off');
    %xlim([1 numHours*3600*3]);
    
    set(gca,'xtick',0:3600*1.5:length(summit),'xticklabel',0:0.5:length(summit)/(3600*3),'TickLength',[0 0]); %,'Clipping','off');
    xlim([1 numHours*3600*3]);
    xlabel("Time since first movement (hours)");
    titleText = [expName,var];
    if drop_NS_XI
        titleText = [titleText,"Omitting non-summiting donors that died of infection"];
    end
    title(titleText);
    if var == "Speed"
        ylim([0 1]);
    elseif var == "Centroid"
        ylim([0 1]);
    end
    
%     yyaxis right;
%     %plotColor = colors{3};
%     plotColor = [1 0 0];
%     plot(siRunning,'Color',plotColor,'LineStyle','--');
%     %plotColor = colors{2};
%     plotColor = [0 0 0];    
%     plot(nsiRunning,'Color',plotColor,'LineStyle','--');
%     ylabel('Number of flies tracked','Color',[0 0 0]);
%     set(gca,'YColor',[0 0 0]);
%     ylim([0 max(horzcat(nsiRunning,siRunning))+1]);
    
    legend({strcat('Summit, N = ',num2str(max(siRunning))),strcat('Non-summit, N = ',num2str(max(nsiRunning))),"Tracked S","Tracked NS"},'Location','Best');

    %xlim([1 length(sPlot)]);

    % Save figure
    set(gcf,'PaperUnits','inches','PaperPosition',[0 0 7.5 6]);
    outName = strcat(expDir,var,'-All ROIS','-',num2str(numHours));
    if strcmp(metric,'mean')
        outName = strcat(outName,"_mean");
    elseif strcmp(metric,'median')
        outName = strcat(outName,"_median");
    end
    if drop_NS_XI
        outName = strcat(outName,"_drop_NS_XI");
    end
    % % % outName = strcat(outName,"_excludingROI16");
    print(strcat(outName,'.pdf'),'-dpdf'); 
    print(outName,'-dpng');
    %saveas(gcf,outName,'epsc');
    disp(outName);
    close;
end