How to add standard errors in bar charts (hatched)?
1 view (last 30 days)
Show older comments
I have got 4 categories (say A,B,C,D) each having 3 values i.e. bar_3_categories=[1 2 3 4;1 2 3 4;1 2 3 4]; Error bars are error_bars=[0.1 0.2 0.3 0.4;0.4 0.5 0.6 0.7;0.7 0.8 0.9 0.1]; I got hatched histogram charts (please refer coding) but unable to add std. error at bars (each bar can be of black boundary). Please help me to add std errors in these graphs
close all clc; % Create original plot fH = gcf; colormap(jet(4)); A=[1 2 3 4;1 2 3 4;1 2 3 4]; h = bar(A); legend('Apple', 'Orange', 'Banana', 'Melon');
% Apply Brandon's function tH = title('Brandon''s applyhatch'); applyhatch_pluscolor(fH, '\-x.', 0, [1 0 1 0], jet(4));
% Apply Brian's function set(tH, 'String', 'Brian''s applyhatch'); applyhatch_plusC(fH, '\-x.', 'rkbk');
set(tH, 'String', 'Original');
0 Comments
Answers (1)
Alessandro La Chioma
on 5 Aug 2017
Hi
and, much better, superbar function in file exchange https://de.mathworks.com/matlabcentral/fileexchange/57499-superbar
0 Comments
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!