I've hit this while implementing scikit-hep/mplhep#303 and realizing the results can be funny if the categorical axis is set with growth=True
. I think it makes more sense to order on the object, than at plotting time. API could look like
h.sort('axis_name', key=list | fcn as passed to sorted())