image thumbnail

Stacked bar chart labels

버전 1.0.0 (2.27 KB) 작성자: Timothy Olsen
Adds labels to individual bar segments in a stacked bar chart.

다운로드 수: 69

업데이트 날짜: 2020/11/22

라이선스 보기

Adds labels to each segment of a stacked bar chart. Labels are positioned within the middle of each bar segment (see example in function image).

The first input to the function (sb) is the handle to a stacked bar chart using the function 'bar', e.g. sb = bar([1 1; 2 2; 3 3],[60 40; 70 30; 20 80],'stacked'); . The second input to the function (t) is the text labels for each bar segment. Optional name-value pair arguments include the fontsize for the text labels (fs), the color of the text labels (col), and an option to skip columns in the labeling process (skip) (useful in situations where whole bars/columns are skipped to add spacing between bars on the x-axis).

Extra details and examples are within the function.

Please feel free to get in touch for any improvements, bugs, etc.

인용 양식

Timothy Olsen (2022). Stacked bar chart labels (https://www.mathworks.com/matlabcentral/fileexchange/83153-stacked-bar-chart-labels), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2020b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!