def despiking_report(dives, depth, raw, baseline, spikes, name=None,
    pcolor_kwargs={}):
    """
    A report for the results of cleaning.despike.

    The function creates a figure object of 3 subplots containing a pcolormesh
    of the original data, the despiked data and the spikes calculated from the
    cleaning.despike function.

    Parameters
    ----------
    dives: numpy.ndarray or pandas.Series
        The dive count (round is down dives, 0.5 is up dives)
    depth: numpy.ndarray or pandas.Series
        The depth array in metres
    raw: numpy.ndarray or pandas.Series
        Array of data variable for cleaning to be performed on.
    baseline: numpy.ndarray or pandas.Series
        The baseline from which outliers are determined.
    spikes: numpy.ndarray or pandas.Series
        Spikes are the residual of [measurements - baseline].
    name: str
        String name for the figure header, if None will try to get a pandas.
        Series.name from raw.
    pcolor_kwargs: dict
        A dictionary of keyword arguements passed to pcolormesh.


    Returns
    -------
    figure: object
        Creates a figure object with 3 subplots containing a pcolormesh of the
        original data, the despiked data and the spikes calculated from the
        cleaning.despike function.

    """
    from matplotlib.pyplot import subplots, cm
    from numpy import array, nanpercentile, ma, isnan
    from . import plot
    if name is None:
        name = 'Variable' if not hasattr(raw, 'name') else raw.name
    x = array(dives)
    y = array(depth)
    z = [array(raw), ma.masked_array(baseline), array(spikes)]
    fig, ax = subplots(3, 1, figsize=[10, 11], dpi=90)
    title = '{}\nDespiking Report'.format(name)
    bmin, bmax = nanpercentile(z[1].data, [2, 98])
    smin, smax = nanpercentile(z[2].data, [2, 98])
    props = dict(cmap=cm.Spectral_r)
    props.update(pcolor_kwargs)
    im = []
    im += plot.pcolormesh(x, y, z[0], ax=ax[0], vmin=bmin, vmax=bmax, **props),
    im += plot.pcolormesh(x, y, z[1], ax=ax[1], vmin=bmin, vmax=bmax, **props),
    im += plot.pcolormesh(x, y, z[2], ax=ax[2], vmin=smin, vmax=smax, **props),
    for i in range(0, 3):
        ymax = y[~isnan(baseline)].max()
        ax[i].set_ylim(ymax, 0)
        ax[i].set_xlim(x.min(), x.max())
        ax[i].set_ylabel('Depth (m)')
        if i != 2:
            ax[i].set_xticklabels([])
        else:
            ax[i].set_xlabel('Dive number')
        ax[i].cb.set_label('Units')
    ax[0].set_title('Original')
    ax[1].set_title('Despiked')
    ax[2].set_title('Spikes')
    fig.tight_layout()
    fig.text(0.47, 1.02, title, va='center', ha='center', size=14)
    p0 = ax[0].get_position()
    p1 = ax[1].get_position()
    ax[0].set_position([p0.x0, p0.y0, p1.width, p0.height])
    return fig
