Error-bar plot for R2014a

I'm trying to plot errors bars for a bar chart, i'm going wrong somewhere.
y = [212206000000 229040000000 39312320000; 119783500000 169247500000 128418300000 ; 211838000000 706581300000 85349300000]; hBar = bar(y) set(gca,'XTickLabel', {'300 ','350 ','400 '}) legend('C','S','T', 'Location','N') grid on ylabel('N/m^{2}') xlabel ('\mum') colormap summer ctr1 = bsxfun(@plus, hBar(1).XData, [hBar(1).XOffset]'); % Centres Of Bar Groups ctr2 = bsxfun(@plus, hBar(1).XData, [hBar(2).XOffset]'); ctr3 = bsxfun(@plus, hBar(1).XData, [hBar(3).XOffset]'); ydt1 = hBar(1).YData; % Y-Data Of Bar Groups ydt2 = hBar(2).YData; ydt3 = hBar(3).YData; hold on for ydt1 = 1:4 hb = get(get(hBar(ydt1),'TEST'), 'XData'); midbar = mean(hb); errorbar(midbar, ydt(:,ydt1), y*0.1(:,ydt1), '.') % plotting errors end hold off

2 个评论

You first wanted to do it in R2014b, and I gave you code that works in HG2 in my Answer to your previous Question.
Note: see Error bars on group bar chart for the R2014b (HG2) version of my code.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Errorbars 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by