I am trying to plot a simple bar graph with 8 bars, all the even bars in one color, all the odd bars in a different color. Below is what I've done:
info = [mean1 mean2 mean3 mean4 mean5 mean6 mean7 nean8];
sky_blue = [86, 180, 233] / 256;
orange = [230, 159, 0] / 256
for d=1:length(info)
plot_bar(d)=bar(info(1,d), 'BarWidth', 0.5);
if mod(d,2)==0
set(plot_bar(d),'FaceColor', sky_blue);
else
set(plot_bar(d),'FaceColor', orange);
end
hold on;
end
For some reason, the bars are stacked vertically, one on top of the other. Could anyone tell me how to seperate the bars horizontally?
Also, how would I go about make a legend which will indicate sky_blue color as the control group and orange as the medicated group? Thanks!
