%% Figure of total means and SDs (accuracy + RTs)

figure;
subplot(2,1,1);
    bar([mean(ResultMat(ResultMat(:,2) == 1,3)),...
    mean(ResultMat(ResultMat(:,2) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 3,3)),...
    mean(ResultMat(ResultMat(:,2) == 4,3))]);
    hold on;
    errorbar([mean(ResultMat(ResultMat(:,2) == 1,3)),...
    mean(ResultMat(ResultMat(:,2) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 3,3)),...
    mean(ResultMat(ResultMat(:,2) == 4,3))],...
    [std(ResultMat(ResultMat(:,2) == 1,3)),...
    std(ResultMat(ResultMat(:,2) == 2,3)),...
    std(ResultMat(ResultMat(:,2) == 3,3)),...
    std(ResultMat(ResultMat(:,2) == 4,3))], 'o') 
    set(gca,'XTickLabel', dotInfo.MAT.attNames);
    title('RTs');
subplot(2,1,2);
    bar([mean(ResultMat(ResultMat(:,2) == 1,4)),...
    mean(ResultMat(ResultMat(:,2) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 3,4)),...
    mean(ResultMat(ResultMat(:,2) == 4,4))]);
    hold on;
    errorbar([mean(ResultMat(ResultMat(:,2) == 1,4)),...
    mean(ResultMat(ResultMat(:,2) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 3,4)),...
    mean(ResultMat(ResultMat(:,2) == 4,4))],...
    [std(ResultMat(ResultMat(:,2) == 1,4)),...
    std(ResultMat(ResultMat(:,2) == 2,4)),...
    std(ResultMat(ResultMat(:,2) == 3,4)),...
    std(ResultMat(ResultMat(:,2) == 4,4))], 'o')
    title('Accuracy');
    set(gca,'XTickLabel', dotInfo.MAT.attNames);

 
 %% Figure of total means and SDs (accuracy + RTs)

figure;
subplot(2,2,1);
    bar([mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 1,3)),...
    mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 1,3)),...
    mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 1,3)),...
    mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 1,3))]);
    hold on;
    errorbar([mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 1,3)),...
    mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 1,3)),...
    mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 1,3)),...
    mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 1,3))],...
    [std(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 1,3)),...
    std(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 1,3)),...
    std(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 1,3)),...
    std(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 1,3))], 'o') 
    set(gca,'XTickLabel', dotInfo.MAT.attNames);
    title('RTs');
subplot(2,2,2);
    bar([mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 2,3))]);
    hold on;
    errorbar([mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 2,3))],...
    [std(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 2,3)),...
    std(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 2,3)),...
    std(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 2,3)),...
    std(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 2,3))], 'o') 
    set(gca,'XTickLabel', dotInfo.MAT.attNames);
    title('RTs');
subplot(2,2,3);
    bar([mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 1,4)),...
    mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 1,4)),...
    mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 1,4)),...
    mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 1,4))]);
    hold on;
    errorbar([mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 1,4)),...
    mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 1,4)),...
    mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 1,4)),...
    mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 1,4))],...
    [std(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 1,4)),...
    std(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 1,4)),...
    std(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 1,4)),...
    std(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 1,4))], 'o')
    title('Accuracy');
    set(gca,'XTickLabel', dotInfo.MAT.attNames);
subplot(2,2,4);
    bar([mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 2,4))]);
    hold on;
    errorbar([mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 2,4))],...
    [std(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 2,4)),...
    std(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 2,4)),...
    std(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 2,4)),...
    std(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 2,4))], 'o')
    title('Accuracy');
    set(gca,'XTickLabel', dotInfo.MAT.attNames);

%% plot change due to cue
    
figure;
subplot(2,1,1);
    bar([mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 1,3))-mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 1,3))-mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 1,3))-mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 2,3)),...
    mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 1,3))-mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 2,3))]);
    set(gca,'XTickLabel', dotInfo.MAT.attNames);
    title('RTs');
subplot(2,1,2);
    bar([mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 1,4))-mean(ResultMat(ResultMat(:,2) == 1 & ResultMat(:,1) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 1,4))-mean(ResultMat(ResultMat(:,2) == 2 & ResultMat(:,1) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 1,4))-mean(ResultMat(ResultMat(:,2) == 3 & ResultMat(:,1) == 2,4)),...
    mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 1,4))-mean(ResultMat(ResultMat(:,2) == 4 & ResultMat(:,1) == 2,4))]);
    title('Accuracy');
    set(gca,'XTickLabel', dotInfo.MAT.attNames);
