bounds=categorical({'aa','bb','cc','dd','ee'});
vals=[1,2,3,4,5]
set(gca,'TickLabelInterpreter','latex','Fontsize',18);
ylabel('Variance','Fontsize',20)
colors = [0 0 1;
1 0 0;
1 0 0;
0 1 0;
0 1 0];
alphas = [1,0.3,1,0.3,1];
b = gobjects(size(bounds));
cla()
hold on
for i =1:numel(bounds)
b(i)=bar(bounds(i),vals(i));
if rem(i,2)==0
line='--';
else
line='-';
end
set(b(i),'FaceColor',colors(i,:),'FaceAlpha',alphas(i),'LineStyle',line);
end
ehigh=[0,0.5,0,0.8,0]
elow=ehigh;
hold on
er = errorbar(bounds,vals,elow,ehigh,'k','LineStyle','none');
er.Color = [0 0 0];
er.LineStyle = 'none';
er.LineWidth=1;
er(1).CapSize=20;