def plot_bands(data, bands, axes, band_type, k_ticks=False, xlabel=None,
               ylabel=None, title=None, separator=None, *args, **kwargs):
    """
    Plot bands from `data` levels and `bands`.
    Only use if you want to plot from arbitrary octave or third octave data.

    data: levels in an 1-D NumPy array.

    axes: `matplotlib.axes` object.

    band_type: `'octave'` or `'third'` are accepted values.

    axes: a `matplotlib.axes` object (`None` by default, optional).

    kHz: if `True` it shows "1k" or "2.5k" instead of "1000" or "2500" as
    tick labels (`False` by default, optional).

    xlabel: a `str` containing label for x axis (optional).

    ylabel: a `str` containing label for y axis (optional).

    title: a `str` containing title (optional).

    separator: a `str` defining the decimal separator. By default takes '.'
    or ',' values according to system settings (when separator is None).
    """
    if axes is None:
        axes = plt.gca()
    factor = 0.1
    min_auto = bands[0] * (1-factor)
    max_auto = bands[-1] * (1+factor)
    axes.set_xlim([min_auto, max_auto])
    axes.set_xscale(band_type)

    # Set tick labels.
    ticklabels = _get_ticklabels(band_type, k_ticks, separator)
    if band_type == 'third':
        third_ticks = True
    elif band_type == 'octave':
        third_ticks = False
    axes.set_xticklabels(ticklabels, minor=third_ticks)

    # Set x and y labels and title.
    if xlabel is not None:
        axes.set_xlabel(xlabel)
    if ylabel is not None:
        axes.set_ylabel(ylabel)
    if title is not None:
        axes.set_title(title)
    return axes.plot(bands, data, *args, **kwargs)
dataset/ETHPy150Open python-acoustics/python-acoustics/acoustics/imaging.py/plot_bands/original