Filter löschen
Filter löschen

Plotting Poissonian Error Bars

4 Ansichten (letzte 30 Tage)
jgillis16
jgillis16 am 18 Aug. 2015
Kommentiert: Star Strider am 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))

Akzeptierte Antwort

Star Strider
Star Strider am 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 Kommentare
jgillis16
jgillis16 am 19 Aug. 2015
Such a simple solution. Thanks again Strider!
Star Strider
Star Strider am 19 Aug. 2015
My pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by