mplhep icon indicating copy to clipboard operation
mplhep copied to clipboard

Suppress `yerr` drawing globally

Open gipert opened this issue 3 years ago • 3 comments

Hi, my question might have a trivial answer but I cannot help myself with the docs or the source code. How do I set yerr=None for all histograms with a global option (in matplotlib, I would look for a rcParams key)? Most of the times I'm not interested in displaying error bars, I would be happier if uncertainty bars were not drawn by default. Thanks!

gipert avatar Feb 09 '22 10:02 gipert

Hi @gipert I don't think this is currently possible. histplot(..., yerr=False) should turn them of on fcn call basis, but we don't have a global setting for this rn.

We have custom (not heavily used) rcParams for labelling and could use the same logic to turn off error bars by default https://github.com/scikit-hep/mplhep/blob/f3306544614bfcd1b8a4c03e08488440b000b75e/src/mplhep/init.py#L30

andrzejnovak avatar Feb 09 '22 11:02 andrzejnovak

Would be great to have such an option.

Apart from this, why not defaulting to yerr=False? I think pretty much all of the histogram plotting libraries around (first of all, ROOT), do this.

gipert avatar Feb 09 '22 11:02 gipert

You're welcome to make a PR or leave this issue open, but it won't be done with any particular priority. I don't think passing histtype and yerr is horribly inconvenient.

I'm a sense it is the default, if you only supply counts and bin edges they aren't automatically computed by default, if you supply a histogram object that carries weights2, the information gets displayed.

andrzejnovak avatar Feb 09 '22 11:02 andrzejnovak