def get_primary_axis(hist):
    """Returns the highest dimension axis, e.g. if 1D histo this will
    return the y-axis.
    """
    dim = hist.GetDimension()
    if dim == 1:
        return hist.GetYaxis()
    elif dim == 2:
        return hist.GetZaxis()