Error bars centered at one bar in multi-bar plot
古いコメントを表示
Hi!
How to I get the error bars to show up at the correct bar and not centered as in the figure below? My y-matrix a 4x7.
Thanks!
name = {'Baseline';'Retro';'Tech';'Sub'};
x = [1:4]
figure
hb = bar(x,y);
set(gca,'xticklabel',name)
hold on
errorbar(x,y,errorminus,errorplus,'.k') % the y means (assumes columns are observations)
hold on
p = plot(x,t,'-o','color','k');
ylabel('Bton CO_2e');
hb(1).FaceColor = '#f46d43';
hb(2).FaceColor = '#fdae61';
hb(3).FaceColor = '#ffffbf';
hb(4).FaceColor = '#abdda4';
hb(5).FaceColor = '#66c2a5';
hb(6).FaceColor = '#3288bd';

legend('FC', 'CK', 'ZZ', 'HK', 'VSBK', 'TK')
1 件のコメント
You code does not run,
name = {'Baseline';'Retro';'Tech';'Sub'};
x = [1:4]
figure
hb = bar(x,y);
set(gca,'xticklabel',name)
hold on
errorbar(x,y,errorminus,errorplus,'.k') % the y means (assumes columns are observations)
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Errorbars についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
