Hi, I quite like to use the TTree::Draw method and I enjoy its automatic binning system. As I understand it, before filling “real” bins, it fills up a buffer with the non-binned values. Once the buffer is full, it then selects maximum and minimum edges, sets up bins, and then all further data is binned accordingly.
This is very useful, but I wonder if it would be simple to add an option: that the automatically-determined bin edges line up on the integers. Often the X coordinate of a histogram is integer-valued, and it makes no sense to have bin edges between integers. You can tell because often newbies think a “TH1I” is for this purpose.
The idea would be to maintain the convenient automatic range determination, and the default number of bins, but to flex the final result so that the bins coincide with integers (possibly integer-multiple wide in the case of large ranges).
Does anyone else think this would be useful? Or is there a short way to achieve the same result with a user-provided function?
Jean-François