How to create a stacked bar plot with error bars?
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello,
I have a set of data split into two uneven categories. Each category contains measurements for three variables: total, organic and inorganic.
I would like to create a stacked bar plot (with a single bar on the xaxis for each category). Within each bar, I would like to plot the organic and inorganic values as stacked. If possible, I would also like to have an error bar appear at the top of each bar displaying +/- 1 standard deviation for the averaged total.
I tried by starting to plot one of the values in a bar graph, and received an error that xdata cannot contain duplicate values:
x = B(1:59,3) %Where B is the predefined excel file; B(1:36,3) = 1 and B(37:59,3) = 2
T = B(1:59,9) %Total values
O = B(1:59,10) %Organic values
I = B(1:59,8) %Inorganic values
for x = B(1:36,3)
y = (1:36,10) %Organic values
figure(1)
bar(x,y1)
end
Any suggestions or insight are welcome; this is my first time attempting a simple bar plot.
Cheers
댓글 수: 1
Star Strider
2017년 12월 2일
Please provide an illustration of the sort of plot you want as the result.
The reason for asking is that standard error (or confidence interval) bars on a stacked bar plot would be difficult for someone looking at the plot to interpret. A reviewer/referree (and I have been one) might not accept a paper with confusing graphics.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!