# Error bars when making histogram

**URL:** <https://root-forum.cern.ch/t/error-bars-when-making-histogram/35795>\
**Category:** Newbie\
**Tags:** python, hist, root\
**Created:** [August 27, 2019, 5:40pm UTC](https://root-forum.cern.ch/t/error-bars-when-making-histogram/35795 "2019-08-27T17:40:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Odagiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/patrick_odagiu/32/19664_2.png) [@Patrick\_Odagiu](https://root-forum.cern.ch/u/Patrick_Odagiu)\
**Post date:** [August 27, 2019, 5:40pm UTC](https://root-forum.cern.ch/t/error-bars-when-making-histogram/35795/1 "2019-08-27T17:40:35Z")

</div>

Hello,

I am having some problems getting the error bars I want on a histogram. As an example, here is the kind of error bars I would want (the checkered bits):

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/b/6/b672b53efa304b3c5d35445ea05f773e1b5fe5d9.png)

I understood that the way to obtain such an effect is to use the draw option “E4”, but once I try to apply this in my code, the histogram disappears. However, it reappears if I use histogram.Draw(“h”). I must also mention that I am using ATLAS Style. I have attached the code that I am using to produce the histogram.

Thank you,  
Patrick.

[code.zip](https://root-forum.cern.ch/uploads/short-url/dNKccNQqzGyJcgeCdGbmwcrfJMG.zip) (1.9 KB)

---

<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:** [August 27, 2019, 6:38pm UTC](https://root-forum.cern.ch/t/error-bars-when-making-histogram/35795/2 "2019-08-27T18:38:53Z")

</div>

Try with:

```auto
mgg.SetFillColor(root.kRed)

```

---

<div class="post-metadata">

**Author:** ![Patrick\_Odagiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/patrick_odagiu/32/19664_2.png) [@Patrick\_Odagiu](https://root-forum.cern.ch/u/Patrick_Odagiu)\
**Post date:** [August 30, 2019, 3:58pm UTC](https://root-forum.cern.ch/t/error-bars-when-making-histogram/35795/3 "2019-08-30T15:58:59Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> mgg.SetFillColor(root.kRed)

Now I can see it, thank you! However, it’s not quite like the effect displayed in the above picture. It seems to me like the signal and the errors, in the example I provided, are two separate histograms overlayed. Is my suspicion correct?

Kind regards,  
Patrick.
