How do I create a stacked bar graph from values in a structured array?
조회 수: 8 (최근 30일)
이전 댓글 표시
If I have a structured array
patient.percentages = { [02 08 09]; [23 20 24]; [] }
and I want to create a stacked bar graph (with each bar having three sections like in the []), how do I draw upon these elements in my bar code?
figure; bar(1:3, [percentages], 0.5, 'stack'); ?
댓글 수: 0
채택된 답변
per isakson
2014년 2월 28일
편집: per isakson
2014년 2월 28일
Try
figure;
bar(1:3, cat(1,patient.percentages{:}), 0.5, 'stack');
댓글 수: 4
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Bar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!