def plot_intensityscale(intscale, fig=None, vminmax=None, kmperpixel=None, unit=None):
    """
    Plot a intensity-scale verification table with a color bar and axis
    labels.

    Parameters
    ----------

    intscale: dict
        The intensity-scale object initialized with
        :py:func:`pysteps.verification.spatialscores.intensity_scale_init`
        and accumulated with
        :py:func:`pysteps.verification.spatialscores.intensity_scale_accum`.

    fig: matplotlib.figure.Figure, optional
        The figure object to use for plotting. If not supplied, a new
        figure is created.

    vminmax: tuple of floats, optional
       The minimum and maximum values for the intensity-scale skill score
       in the plot.
       Defaults to the data extent.

    kmperpixel: float, optional
       The conversion factor from pixels to kilometers. If supplied,
       the unit of the shown spatial scales is km instead of pixels.

    unit: string, optional
       The unit of the intensity thresholds.
    """
    if fig is None:
        fig = plt.figure()

    ax = fig.gca()

    SS = spatialscores.intensity_scale_compute(intscale)

    vmin = vmax = None
    if vminmax is not None:
        vmin = np.min(vminmax)
        vmax = np.max(vminmax)
    im = ax.imshow(SS, vmin=vmin, vmax=vmax, interpolation="nearest", cmap=cm.jet)
    cb = fig.colorbar(im)
    cb.set_label(intscale["label"])

    if unit is None:
        ax.set_xlabel("Intensity threshold")
    else:
        ax.set_xlabel("Intensity threshold [%s]" % unit)
    if kmperpixel is None:
        ax.set_ylabel("Spatial scale [pixels]")
    else:
        ax.set_ylabel("Spatial scale [km]")

    ax.set_xticks(np.arange(SS.shape[1]))
    ax.set_xticklabels(intscale["thrs"])
    ax.set_yticks(np.arange(SS.shape[0]))
    if kmperpixel is None:
        scales = intscale["scales"]
    else:
        scales = np.array(intscale["scales"]) * kmperpixel
    ax.set_yticklabels(scales)
Plot a intensity-scale verification table with a color bar and axis
labels.

Parameters
----------

intscale: dict
The intensity-scale object initialized with
:py:func:`pysteps.verification.spatialscores.intensity_scale_init`
and accumulated with
:py:func:`pysteps.verification.spatialscores.intensity_scale_accum`.

fig: matplotlib.figure.Figure, optional
The figure object to use for plotting. If not supplied, a new
figure is created.

vminmax: tuple of floats, optional
The minimum and maximum values for the intensity-scale skill score
in the plot.
Defaults to the data extent.

kmperpixel: float, optional
The conversion factor from pixels to kilometers. If supplied,
the unit of the shown spatial scales is km instead of pixels.

unit: string, optional
The unit of the intensity thresholds.
pysteps/verification/plots.py