Error-bar plot for R2014a
Afficher commentaires plus anciens
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 commentaires
Star Strider
le 9 Avr 2015
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
le 9 Avr 2015
Réponses (0)
Catégories
En savoir plus sur Errorbars dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!