TAxis::GetXbins

TAxis::GetXbins returns an empty array when the axis has been created for example from an histogram with equals bins, and return a non-empty array when it has been created by an histogram with non-uniform binning.

It would be good to uniform the two cases: always return a non-empty array. In addition this behaviour is not documented.

Hi,

We prefer not to do this. The array is stored in the axis and we do not want to store in case of equal binning useless information. Also the fact that the array is empty is used as a check for uniform binning.

I agree however that this behaviour should be documented

Best Regards

Lorenzo

You don’t need to store the vector of edges for the uniform binning case. You can generate it when it is asked. The only problem is that the value is returned by pointer.

In my opinion a function called “GetXbins” (why X?) must return the bins, as the name of the function says. If it is used for internal purpose, with special cases (as the uniform binning returning 0) you should make it private or change the name.

Hi,
The problem is that is not used for internal purpose only, but it could be used by anybody.
I think what you are asking is a quite large change causing backward incompatibility for users.

Your feedback is anyway very useful and we will take this into account when re-designig the histogram and the axis classes

Best Regards

Lorenzo