def METHOD_NAME(data, axis):
    """
    Set and update the `~matplotlib.axis.Axis` units.
    Parameters
    ----------
    data : str or iterable of str
    axis : `~matplotlib.axis.Axis`
        axis on which the data is plotted
    Returns
    -------
    `.UnitData`
        object storing string to integer mapping
    """
    # the conversion call stack is default_units -> axis_info -> convert
    if axis.units is None:
        axis.set_units(UnitData(data))
    else:
        axis.units.update(data)
    return axis.units