Feature request: poisson errorbar for hist

Most of histogram have poisson error. would be nice to have something like hist( xxxxx, errorbar=True) Right now we have to do something similar to

h, e, p = hist(data, bins=100)
errorbar((e[1:]+e[:-1])/2., h, sqrt(h))

Few additional point

  • a plus if it does asymmetric error bar
  • another plus if it can take into account the weight correctly for both using sum(weight^2) or just sum(weight).

Author: Fantashit

1 thought on “Feature request: poisson errorbar for hist

  1. I’m going to close this. a) its really old, b) I don’t think Matplotlib should make any assumptions about the underlying statistics that go into deciding errorbars.

    So the remaining issue is whether its worth decorating the histograms with a valerr or yerr argument and drawing errorbars. I’m not seeing a compelling case other than computing the midpoints of the bins and passing to errorbar is mildly irritating. The problem with rolling the decorator in with the histogram plotting is then folks will want to pass a bunch of errorbar kwargs to control their properties. I don’t think the complication is worth it.

    It seems to me that if someone has a use case for always adding Poisson error bars to a histogram, they could write themselves a pretty straightforward wrapper.

Comments are closed.