bar with asymmetric error bounds in Matlab

我的梦境 提交于 2020-01-05 09:26:33

问题


I want to draw a bar with error bounds like this http://www.mathworks.ch/matlabcentral/fileexchange/9377-barerror. There are many scripts to do this around that combine bar() and errorbar(). But all I found can only deal with symmetric errors. Can anyone show me how to add asymmetric error bounds like errorbar(X,Y,L,U) but on bar, not on curve? Thanks.


回答1:


You can plot errorbars over your bar chart:

 data = 1:10;
 eH = rand(10,1);
 eL = rand(10,1);

 figure;
 hold all;
 bar(1:10, data)
 errorbar(1:10, data, eL, eH, '.')


来源:https://stackoverflow.com/questions/7816663/bar-with-asymmetric-error-bounds-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!