function [ output_args ] = plot_psd_5sec_together( out1,out2, freq, mytitle)
    stimulusA = [1 3 5 7 9 11 14 16 18 20];%condition 1
    stimulusB = [2 4 6 8 10 12 13 15 17 19];%condition 2
    target = 5;
    figure('name',mytitle);
    %% data1
    temp = squeeze(mean(out1,3));
    temp = temp(:,any(temp));
    out(:,1) = mean(temp(:,floor(size(temp,2)*1/3:size(temp,2)*2/3)),2);
    plot(freq,out(:,1),'r','Linewidth',1);hold on;
    qq = mean(out,2);

    %% data 2
    temp2 = squeeze(mean(out2,3));
    temp2 = temp2(:,any(temp2));
    out22(:,1) = mean(temp2(:,floor(size(temp2,2)*1/3:size(temp2,2)*2/3)),2);%;mean(temp2,2);
    plot(freq,out22(:,1),'k','Linewidth',1);
    qq2 = mean(out22,2);
    legend('A-pattern','B-Pattern');
    
    %% plot whatever
    tt(stimulusA) = qq(stimulusA)-qq2(stimulusA);
    tt(stimulusB) = qq2(stimulusB) - qq(stimulusB);
    plot(freq,tt,'--r');
    %plot(xlim,[qq(target) qq(target)],'--r');
    plot([8 8.4 8.8 9.2 9.6 10 10.6 11 11.4 11.8],qq([1 3 5 7 9 11 14 16 18 20]),'ok','markers',12);

    %plot(xlim,[qq2(target) qq2(target)],'--k');
    plot([8.2 8.6 9 9.4 9.8 10.2 10.4 10.8 11.2 11.6],qq2([2 4 6 8 10 12 13 15 17 19]),'ok','markers',12);
    xlim([8 11.8]);
    set(gca,'XTick',[8:0.2:11.8]);
    set(gca,'XTickLabelRotation',45);
    box off;
    ylabel('uV');
    xlabel('Frequency');
    set(gca,'fontsize',20)
    hold off;
    
%% plot std analysis

    figure('name',mytitle);
    tempSTD = std(out1,[],3);
    tempSTD = tempSTD(:,any(tempSTD));
    outSTD(stimulusA,:) =tempSTD(stimulusA,floor(size(tempSTD,2)*1/3:size(tempSTD,2)*2/3));
    tempSTD2 = std(out2,[],3);
    tempSTD2 = tempSTD2(:,any(tempSTD2));
    outSTD(stimulusB,:) =tempSTD2(stimulusB,floor(size(tempSTD2,2)*1/3:size(tempSTD2,2)*2/3));
    h1 = boxplot(outSTD','Labels',num2cell(freq));
    set(h1,'linewidth',2);
    hold on;%figure('name',[mytitle ' diff']);
    outSTDTogether(stimulusB,:) = tempSTD(stimulusB,floor(size(tempSTD,2)*1/3:size(tempSTD,2)*2/3));
    outSTDTogether(stimulusA,:) = tempSTD2(stimulusA,floor(size(tempSTD2,2)*1/3:size(tempSTD2,2)*2/3));
    boxplot(outSTDTogether','colors','k','Labels',num2cell(freq));
end

