MATLAB: How to change the color of the bars in a bar chart

bar chartr2014b

Best Answer

Here’s one way:
d = magic(3);
figure(1)
hb = bar(d)
hb(1).FaceColor = 'r';
hb(2).FaceColor = 'm';
hb(3).FaceColor = 'c';