Create Error bar and title into the bar chart
6 views (last 30 days)
Show older comments
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');% use strcmp(), not "==".
bardata = MeanVariantSvelocity(scaleSelection);
bh = bar(barData);
黑洞。FaceColor ='flat';
% Find which bars have velocity==50
velocitySelection = velocity == 50;
velocityBarIdx = ismember(find(scaleSelection), find(velocitySelection));
% Choose two colors
barColors = [0 0 1; 1 0 1];
%颜色vel = 50 bar
cmap = barColors(velocityBarIdx+1,:);
黑洞。CData =提出;
[vgroup, vg] = findgroups (clean_ds.variants);
title = ('like');
% % add x tick labels
ax = bh.Parent;
ax.XTick = 1:numel(barData);
ax.xticklabel = vg;
ax.TickLabelInterpreter ='none';
xtickangle(ax, 45)% or try 90 degrees
my title is also not working.
Do you guys can help me?
2 Comments
Adam Danz
on 14 May 2020
问题副本
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');% use strcmp(), not "==".
bardata = MeanVariantSvelocity(scaleSelection);
bh = bar(barData);
黑洞。FaceColor ='flat';
% Find which bars have velocity==50
velocitySelection = velocity == 50;
velocityBarIdx = ismember(find(scaleSelection), find(velocitySelection));
% Choose two colors
barColors = [0 0 1; 1 0 1];
%颜色vel = 50 bar
cmap = barColors(velocityBarIdx+1,:);
黑洞。CData =提出;
[vgroup, vg] = findgroups (clean_ds.variants);
title = ('like');
% % add x tick labels
ax = bh.Parent;
ax.XTick = 1:numel(barData);
ax.xticklabel = vg;
ax.TickLabelInterpreter ='none';
xtickangle(ax, 45)% or try 90 degrees
my title is also not working.
Do you guys can help me?
Answers (1)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!