# gROOT.SetWebDisplay() alters errorbars from Poisson to Normal?

**URL:** <https://root-forum.cern.ch/t/groot-setwebdisplay-alters-errorbars-from-poisson-to-normal/62335>\
**Category:** ROOT\
**Tags:** graphics, python, hist\
**Created:** [November 28, 2024, 12:40am UTC](https://root-forum.cern.ch/t/groot-setwebdisplay-alters-errorbars-from-poisson-to-normal/62335 "2024-11-28T00:40:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgartner](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@rgartner](https://root-forum.cern.ch/u/rgartner)\
**Post date:** [November 28, 2024, 12:40am UTC](https://root-forum.cern.ch/t/groot-setwebdisplay-alters-errorbars-from-poisson-to-normal/62335/1 "2024-11-28T00:40:49Z")

</div>

Dear ROOT experts,

I am seeing some strange behavior of errorbars when using `ROOT.gROOT.SetWebDisplay()`. I want to have Poisson errorbars, so I use the option ` histo.SetBinErrorOption(ROOT.TH1.kPoisson)`, which leads to Poisson errorbars, when I draw the histogram and save the canvas as a png while `ROOT.gROOT.SetWebDisplay()` is commented out. However, when I want to view the histogram in an interactive web display instead of a png file the displayed errorbars are not Poisson errorbars anymore. Here is a minimal example:

```auto
import ROOT
import numpy as np

ROOT.gROOT.SetWebDisplay()
ROOT.EnableThreadSafety()
ROOT.EnableImplicitMT()
ROOT.gEnv.SetValue("WebGui.HttpThreads", 150)
ROOT.TH1.AddDirectory(False)
ROOT.gStyle.SetOptStat("e")

histo = ROOT.TH1F("histo", "histo", 20, -5, 5)

histo.SetBinErrorOption(ROOT.TH1.kPoisson)

for i in range(10):
    histo.Fill(np.random.normal())

canvas = ROOT.TCanvas("canvas", "Canvas", 800, 600)
histo.Draw("E0")
canvas.Update()
canvas.Draw()

```

Is there a way to display the histogram in the interactive webbrowser with Poisson errorbars?

Many thanks in advance.  
Rebecca  
\_

_ROOT Version:_ 6.32.02  
_Platform:_ Not Provided  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [November 28, 2024, 9:27am UTC](https://root-forum.cern.ch/t/groot-setwebdisplay-alters-errorbars-from-poisson-to-normal/62335/2 "2024-11-28T09:27:28Z")

</div>

Hi Rebecca,

`TH1::SetBinErrorOption` is not handled yet web graphics.  
By chance there is no any tutorial in ROOT and therefore never saw it before.

I will try to implement it.

Regards,  
Sergey

---

<div class="post-metadata">

**Author:** ![rgartner](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@rgartner](https://root-forum.cern.ch/u/rgartner)\
**Post date:** [November 29, 2024, 5:33am UTC](https://root-forum.cern.ch/t/groot-setwebdisplay-alters-errorbars-from-poisson-to-normal/62335/3 "2024-11-29T05:33:57Z")

</div>

Hi Sergey,

alright, thanks! Once it’s successfully implemented it’d be great if you could let me know in which ROOT version I can find it.

Best,  
Rebecca

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [November 29, 2024, 1:45pm UTC](https://root-forum.cern.ch/t/groot-setwebdisplay-alters-errorbars-from-poisson-to-normal/62335/4 "2024-11-29T13:45:42Z")

</div>

Hi Rebecca,

I add support of Poisson errors to JSROOT.

> **[JSROOT examples](https://jsroot.gsi.de/dev/examples.htm?more#th1_poisson)**
>
> Web page shows supported ROOT classes and correspondent draw options

It will be part of next ROOT 6.36 release.

You may use JSROOT directly from our development server:

```auto
export JSROOTSYS=https://jsroot.gsi.de/dev/

```

But it most probably only will work for you with newest ROOT 6.34.00 - which was released today.

Regards,  
Sergey

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [December 13, 2024, 1:46pm UTC](https://root-forum.cern.ch/t/groot-setwebdisplay-alters-errorbars-from-poisson-to-normal/62335/5 "2024-12-13T13:46:09Z")

</div>

Closed on December 13, 2024, 1:46pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
