Bar with errorbars

버전 1.3.0.0 (1.77 KB) 작성자: Venn Ravichandran
This code plots bars with errorbars, as simple as that.
다운로드 수: 5.1K
업데이트 날짜: 2011/6/22

라이선스 보기

As of now (2009-Jul-13), MATLAB doesn't have a built-in function to plot bars with with error bars on top of them. This function solves that problem.

To a beginning user, this provides a very simple way of plotting bar with errorbars with a simple command:
errorbarbar(y,e); % where y is the height of the bars and e is the limit to plot as error bars (of length 2*e, about y).

For an intermediate user, this function provides the handles to the BAR and ERRORBAR lines for further modification.
[b,e] = errorbarbar(y,e); % or ...
[b,e] = errorbarbar(x,y,e); % where x is center location of the group of bars

For an advanced user, this function also provides ways to modify any and all of the bar and line series properties while plotting it in the first place.

Example:
barSettings = {'facealpha',0.5,'edgecolor',[0.5 0.5 0.5]};
lineSettings = {'linestyle','--','linewidth',2};
[b,e] = errorbarbar(x,y,e,barSettings,lineSettings);
set(b,'facecolor',[0 0.5 0]); % set all bars to color green

Hint: You can use the lineSettings variable to use distinct upper and lower limits.

What it DOESN'T do:
1. Plot horizontal bar graphs
2. Work with bar(y,e,barSettings,lineSettings). Instead, use:
bar(x,y,e,barSettings,lineSettings).

인용 양식

Venn Ravichandran (2024). Bar with errorbars (https://www.mathworks.com/matlabcentral/fileexchange/24718-bar-with-errorbars), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2007b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Data Distribution Plots에 대해 자세히 알아보기
도움

도움 준 파일: superbar

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.3.0.0

Error bars no longer have legends of their own. If you want them back on, then comment out line 63 :)

1.2.0.0

Now works with stacked bars as well.

1.1.0.0

Changed a bug which caused the program to give an error if either the barSettings or lineSettings was empty.

1.0.0.0