def METHOD_NAME(unit, axis):
    """Set the axis label based on unit
    Parameters
    ----------
    unit : Unit object, string, or tuple
        This parameter comes from unyt_arrayConverter.default_units() or from
        user code such as Axes.plot(), Axis.set_units(), etc. In user code, it
        is possible to convert the plotted units by specifing the new unit as
        a string, such as "ms", or as a tuple, such as ("J", "thermal")
        following the call signature of unyt_array.convert_to_units().
    axis : Axis object
    Returns
    -------
    AxisInfo object with the label formatted as in-line math latex
    """
    if isinstance(unit, tuple):
        unit = unit[0]
    unit_obj = unit if isinstance(unit, Unit) else Unit(unit)
    name = unyt_arrayConverter._axisnames.get(axis, "")
    if unit_obj.is_dimensionless:
        label = name
    else:
        name += " "
        unit_str = unit_obj.latex_representation()
        if unyt_arrayConverter._labelstyle == "[]":
            label = name + "$\\left[" + unit_str + "\\right]$"
        elif unyt_arrayConverter._labelstyle == "/":
            axsym = "$q_{\\rm" + axis.axis_name + "}$"
            name = axsym if name == " " else name
            if "/" in unit_str:
                label = name + "$\\;/\\;\\left(" + unit_str + "\\right)$"
            else:
                label = name + "$\\;/\\;" + unit_str + "$"
        else:
            label = name + "$\\left(" + unit_str + "\\right)$"
    return AxisInfo(label=label.strip())