필터 지우기
필터 지우기

Plotting error bars in different scale?

조회 수: 3 (최근 30일)
Auryn_
Auryn_ 2018년 5월 30일
댓글: Ameer Hamza 2018년 5월 30일
Hi,
I plotted the following:
x = 1:5;
y = 100*[0.2466 0.2195 0.1976 0.1796 0.1663];
err = 100*[0.0523 0.0494 0.0469 0.0447 0.0430];
errorbar(x,y,err)
which results in this:
My question is: why are the errorbars so big? If I look at the values at the y axis, the first error bar with a value of 5.23 goes from (approximately) y=19.5 to y=29.9, which is 10.5, not 5.23!
Can you help me to understand this?
Thanks!

채택된 답변

Ameer Hamza
Ameer Hamza 2018년 5월 30일
Because the err in errorbar() defines the length of error bar from mean position. Therefore the error bar varies from 24.66-5.23=19.46 to 24.66+5.2=29.86. This is exactly what you observed. To correct, divide the err by 2
err = 100*[0.0523 0.0494 0.0469 0.0447 0.0430]/2;
  댓글 수: 2
Auryn_
Auryn_ 2018년 5월 30일
Thanks!
Ameer Hamza
Ameer Hamza 2018년 5월 30일
you are welcome.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Errorbars에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by