Home | News | Documentation | Download

TAxis FixedToVariable and VariableToFixed proposal

I would like to propose that two methods are added to the TAxis class: FixedToVariable and VariableToFixed.
So, an axis which was created as a “fixed bin sizes” one could be converted into a “variable bin sizes” one and the opposite.
Note: in case of the “VariableToFixed” method, we would not preserve bin widths, only the “low-edge”, the “upper-edge” and the number of bins would be used / preserved.

I guess I would like to have:

FixedToVariable(Double_t *xbins = 0)
FixedToVariable(Double_t xmin = 0., Double_t xmax = 0.)
VariableToFixed(Double_t xmin = 0., Double_t xmax = 0.)

If the user provides “xbins” or “xmin < xmax” then use them when calculating new bin edges / limits, otherwise calculate bin edges using the existing “low-edge” and “upper-edge” of the axis.

I don’t have any preference for what these methods should return, so maybe “void” is a good choice.

BTW. maybe you could also think about adding a “Scale” method:

I guess @moneta can comment about your suggestion.

Was @moneta able to comment on this? A similar question was asked: