How to insert error bars in interpolation plot?

조회 수: 9 (최근 30일)
Sara Filippini
Sara Filippini 2020년 11월 16일
답변: Deepak Meena 2020년 11월 20일
My plot is a linear interpolation of N scatter points. I'm trying to mark those points as bar errors, and tune the length of the bar errors according to the y axis.
For example: I have a linear interpolation of the gain of an amplifier, I know that the average noise is 100 mV, I want to have a 100 mV bar for each scatter point.
Thank you everyone!
  댓글 수: 1
Rik
Rik 2020년 11월 16일
What have you tried?
Have a read here and here. It will greatly improve your chances of getting an answer.

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

답변 (1개)

Deepak Meena
Deepak Meena 2020년 11월 20일
Hi Sara,
you can refer to the following documentation to plot error bars in interpolated plots:
Following example illustrate how you can use the above functions :
x = 0:pi/4:2*pi;
v = sin(x);
xq = 0:pi/16:2*pi;
err = 0.5*ones(size(v));
figure
vq1 = interp1(x,v,xq);
plot(x,v,'o',xq,vq1,':.');%%interpolated data
hold on
errorbar(x,v,err);%putting error bars on the original points
so the interpolated data looks like this:
and the plot with the error bars looks like this
Hope this helps
Thanks
Deepak

카테고리

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

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by