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

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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Errorbars에 대해 자세히 알아보기

질문:

2015년 4월 9일

댓글:

2015년 4월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by