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

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:

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


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

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

Hi Rebecca,

I add support of Poisson errors to JSROOT.

It will be part of next ROOT 6.36 release.

You may use JSROOT directly from our development server:

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