Error bars with zero standard deviation.
이전 댓글 표시
Hello,
I have plotted a graph with x- and y-dataset. The standard deviation (in y-axis) has the following values and I intend to plot the error bars.
std_dev = [0 0.0295 0.0090 0.1239 0 0.5667 0.2855 0.0857]
Can I prevent the error-bars from appearing for dataset where std deviation is zero?
Thanks.
답변 (1개)
KALYAN ACHARJYA
2020년 1월 29일
std_dev = [0 0.0295 0.0090 0.1239 0 0.5667 0.2855 0.0857];
%Lets suppose
err=rand(1,8);
idx=find(std_dev~=0)
errorbar(std_dev(idx),err(idx));
댓글 수: 4
Chirag Patil
2020년 1월 29일
KALYAN ACHARJYA
2020년 1월 29일
std_dev = [0.33 0.0295 0.0090 0.1239 0.434 0.5667 0.2855 0.0857 ];
err=rand(1,8); err(2) = 0 ;
idx=find(err~=0);
errorbar(std_dev(idx),err(idx),'o','LineWidth',2 );
Chirag Patil
2020년 2월 6일
Matthijs
2021년 2월 16일
Hello,
In order to show std_dev(2) you could use the x values and plot().
std_dev = [0.33 0.0295 0.0090 0.1239 0.434 0.5667 0.2855 0.0857 ];
xdata = 1:8;
err=rand(1,8); err(2) = 0 ;
idx=find(err~=0);
figure, hold on
plot(xdata,std_dev,'o--')
errorbar(xdata(idx),std_dev(idx),err(idx), 'LineStyle', 'none');
카테고리
도움말 센터 및 File Exchange에서 Errorbars에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!