mplhep
mplhep copied to clipboard
Suppress `yerr` drawing globally
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!
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
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.
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.