I have the following code that makes a plot:
dfs = [0 5 10 15 20 25 ];
Intensities = [0.0593 0.0910 0.1115 0.0611 0.0975 0.0715] ;
SE = [0.2165 0.2068 0.2555 0.2479 0.2340 0.2239];
errorbar(dfs, Intensities, SE, 'ro');
hold on
plot(dfs,Intensities,'bo');
title('\fontsize{14}Intensities per condition');
hold off;
ylim([-0.2 0.5])
names = {'\fontsize{12}Cond1, Group1'; '\fontsize{12}Cond2, Group1'; '\fontsize{12}Cond1, Group2'; '\fontsize{12}Cond2, Group2'; '\fontsize{12}Cond1, Group3';'\fontsize{12}Cond2, Group3'};
set(gca, 'xtick', dfs, 'xticklabel', names);
xlim([-1 26]); %just for better visualisation
ylabel('\fontsize{14}Intensities')
I would like to group the dots with their errors bars pairwise. So the dot (point estimate) 1, 3, and 5 all belong to condition 1, while dots 2, 4 and 6 belong to condition 2. I mean just that there should be some indication that 1, 3, 5 belong to condition 1 and 2, 4, 6 to condition 2, for instance by a legend. But legend('Condition 1','Condition 2') does not work properly here. Putting all the information on the xaxis ticks is just too much content. Alternatively it would also be OK to make clear that the first 2 belong to group1, the next two to group2 etc.
What could be done?


Accuracies. - Dev-iL