필터 지우기
필터 지우기

How to create a stacked bar plot with error bars?

조회 수: 4 (최근 30일)
DrWooo
DrWooo 2017년 12월 1일
댓글: Star Strider 2017년 12월 2일
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
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 CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by