# Binomial Distribution

**URL:** <https://root-forum.cern.ch/t/binomial-distribution/49353>\
**Category:** Newbie\
**Created:** [March 24, 2022, 9:35pm UTC](https://root-forum.cern.ch/t/binomial-distribution/49353 "2022-03-24T21:35:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/roy/32/30362_2.png) [@Roy](https://root-forum.cern.ch/u/Roy)\
**Post date:** [March 24, 2022, 9:35pm UTC](https://root-forum.cern.ch/t/binomial-distribution/49353/1 "2022-03-24T21:35:20Z")

</div>

I wanted to know if there is anyway to include the vertical bar of binomial uncertainty itself in the plot in histogram.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 25, 2022, 8:30am UTC](https://root-forum.cern.ch/t/binomial-distribution/49353/2 "2022-03-25T08:30:51Z")

</div>

For every bin of your histogram, you can calculate its “error” (using its “content”) and then use [TH1::SetBinError](https://root.cern/doc/master/classTH1.html#a73a3e35e3134bd53ddad841143f86573)

In principle, one can use [TH1::SetBinErrorOption](https://root.cern/doc/master/classTH1.html#ab10e942dedc86b135592fa942d928819) to specify [statistics for histogram bin errors from Poisson interval at 68.3% (1 sigma) or 95% (~2 sigma)](https://root.cern/doc/master/classTH1.html#ac6e38c12259ab72c0d574614ee5a61c7), and [histogram error bars drawing options](https://root.cern/doc/master/classTHistPainter.html#HP09) will use this information.

If you want other “asymmetric errors”, then you need to switch to [TGraphAsymmErrors](https://root.cern/doc/master/classTGraphAsymmErrors.html)

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [March 25, 2022, 4:10pm UTC](https://root-forum.cern.ch/t/binomial-distribution/49353/3 "2022-03-25T16:10:32Z")

</div>

Hi Roy,  
For computing and then displaying binomial uncertainties, you can also look at the [`TEfficiency`](https://root.cern.ch/doc/master/classTEfficiency.html) class

Lorenzo
