Hi guys
I have a bar chart and I want to add a error bar. But I dont know how to do that.
I have added my data set and this is my bar chart:
figure();
scaleSelection = strcmp(scale,'like');
barData = meanVariantsVelocity(scaleSelection);
bh = bar(barData);
bh.FaceColor = 'flat';
velocitySelection = velocity == 50;
velocityBarIdx = ismember(find(scaleSelection), find(velocitySelection));
barColors = [0 0 1; 1 0 1];
cmap = barColors(velocityBarIdx+1,:);
bh.CData = cmap;
[vgroup, vg] = findgroups (clean_ds.variants);
title = ('like');
ax = bh.Parent;
ax.XTick = 1:numel(barData);
ax.XTickLabel = vg;
ax.TickLabelInterpreter = 'none';
xtickangle(ax, 45)
my title is also not working.
Do you guys can help me?
2 Comments
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/506469-create-error-bar-and-title-into-the-bar-chart#comment_847349
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/506469-create-error-bar-and-title-into-the-bar-chart#comment_847349
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/506469-create-error-bar-and-title-into-the-bar-chart#comment_847359
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/506469-create-error-bar-and-title-into-the-bar-chart#comment_847359
Sign in to comment.