2010-04-22 18:25:35

Convention for numbering bins in ROOT Histogram

For all histogram types: nbins, xlow, xup

bin = 0; underflow bin
bin = 1; first bin with low-edge xlow INCLUDED
bin = nbins; last bin with upper-edge xup EXCLUDED
bin = nbins+1; overflow bin

See TH1 in detail.


  1) nbins = 5, xlow = 0, xup = 5
       ---------------------
       | 1 | 2 | 3 | 4 | 5 |    5 : nbins
       ---------------------
       0   1   2   3   4   5


  2)  offset = -0.5, nbins = 5, xlow = offset, xup = 5+offset
       ---------------------
       | 1 | 2 | 3 | 4 | 5 |    5 : nbins
       ---------------------
     0   1   2   3   4   5



Posted by Jeong Han Lee | Permanent link