I'm using Matlab R2020b.
Why are bar outline lines (the black ones) very wide using a loop to change the colours for each bar?
col(1,:) = [1 0 0]; % -- red
col(2,:) = [0 1 0]; % -- green
col(3,:) = [0 0 1]; % -- blue
col(4,:) = [1 1 0]; % -- yellow
figure
b(1) = bar(dt3(1),p3(1),'FaceColor',col(1,:),'BarWidth', 1, 'LineWidth',0.001);
hold on;
for i=2:length(dt3)
if cid3(i) ~= cid3(i-1)
if c == 4
c = 1;
else
c = c + 1;
end
b(i) = bar(dt3(i),p3(i),'FaceColor',col(c,:),'BarWidth', 1, 'LineWidth',0.001);
txt{k} = num2str(cid3(i));
lh(k) = b(i);
k = k + 1;
else
b(i) = bar(dt3(i),p3(i),'FaceColor',col(c,:),'BarWidth', 1, 'LineWidth',0.001);
end
end
As can you see, it turns difficult to see the colorurs right because the black bars are almost wider.
However, if I plot the same bar graph directly without changing colours they are thinner (the blue ones)
bar(dt3,p3);
The dark blue bars are thinner.