Plotting Poissonian Error Bars

1 view (last 30 days)
jgillis16
jgillis16 on 18 Aug 2015
Commented: Star Strider on 19 Aug 2015
I am inputting poissonian error bars on a plot I drafted. The only problem is that there are numerous points on the graph, therefore numerous associated error bars. This makes the graph look messy as well as unreadable. Would there be anyway to extrapolate the vertical distance each bar has from the line of the plot itself and plot the two vertical extremes of the error bars as separate 'curves' on the plot instead of individual error bars?
Code is below:
YYYYA = sort(YYYY, 'ascend');
S = sqrt(YYYYA);
figure(9)
plot(XX2, YYYYA, errorbar(XX2,YYYYA,S))

Accepted Answer

Star Strider
Star Strider on 18 Aug 2015
I’m not sure what ‘S’ is, but I assume it is one extreme of your symmetric error limits. To plot error _bands) above and below your principal plot, use the hold function:
figure(9)
plot(XX2, YYYYA) % Data
hold on
plot(XX2, YYYYA+S) % Upper Error Band
plot(XX2, YYYYA-S) % Lower Error Band
hold off
This is obviously untested code.
  2 Comments
jgillis16
jgillis16 on 19 Aug 2015
Such a simple solution. Thanks again Strider!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!