What I expect from the output below the code is 4 different columns on the line chart, each with different colors, and with tick marks "a", "b", "c" and "d", respectively. The colors are beautiful, but only the first bar has an “a” mark, and the other three have no labels. How can I achieve marking markings on the bar panel, highlighting them in different colors? I am using version 2010b. Thanks!
deneme = [1 2 3 4];
figure;
for i=1:length(deneme)
if i==1
colorcode = 'b';
elseif i==2
colorcode = 'g';
elseif i==3
colorcode = 'r';
else
colorcode = 'k';
end
bar(i, deneme(i), colorcode);
hold on;
end
set(gca,'XTickLabel',{'a'; 'b'; 'c'; 'd'})
source
share