def peaks_plot(data, starttime, samp_rate, peaks=[(<NUM_LIT:0>, <NUM_LIT:0>)], **kwargs):
import matplotlib.pyplot as plt<EOL>npts = len(data)<EOL>t = np.arange(npts, dtype=np.float32) / (samp_rate * <NUM_LIT>)<EOL>fig = plt.figure()<EOL>ax1 = fig.add_subplot(<NUM_LIT>)<EOL>ax1.plot(t, data, '<STR_LIT:k>')<EOL>ax1.scatter(peaks[<NUM_LIT:0>][<NUM_LIT:1>] / (samp_rate * <NUM_LIT>), abs(peaks[<NUM_LIT:0>][<NUM_LIT:0>]),<EOL>color='<STR_LIT:r>', label='<STR_LIT>')<EOL>for peak in peaks:<EOL><INDENT>ax1.scatter(peak[<NUM_LIT:1>] / (samp_rate * <NUM_LIT>), abs(peak[<NUM_LIT:0>]), color='<STR_LIT:r>')<EOL><DEDENT>ax1.legend()<EOL>ax1.set_xlabel("<STR_LIT>" % starttime.isoformat())<EOL>ax1.axis('<STR_LIT>')<EOL>fig.suptitle('<STR_LIT>')<EOL>fig = _finalise_figure(fig=fig, **kwargs)  <EOL>return fig<EOL>
Plot peaks to check that the peak finding routine is running correctly.

Used in debugging for the EQcorrscan module.

:type data: numpy.array
:param data: Numpy array of the data within which peaks have been found
:type starttime: obspy.core.utcdatetime.UTCDateTime
:param starttime: Start time for the data
:type samp_rate: float
:param samp_rate: Sampling rate of data in Hz
:type peaks: list
:param peaks: List of tuples of peak locations and amplitudes (loc, amp)

:returns: :class:`matplotlib.figure.Figure`

.. rubric:: Example

>>> import numpy as np
>>> from eqcorrscan.utils import findpeaks
>>> from eqcorrscan.utils.plotting import peaks_plot
>>> from obspy import UTCDateTime
>>> data = np.random.randn(200)
>>> data[30] = 100
>>> data[60] = 40
>>> threshold = 10
>>> peaks = findpeaks.find_peaks2_short(data, threshold, 3)
>>> peaks_plot(data=data, starttime=UTCDateTime("2008001"),
...            samp_rate=10, peaks=peaks)  # doctest: +SKIP

.. plot::

    import matplotlib.pyplot as plt
    import numpy as np
    from eqcorrscan.utils import findpeaks
    from eqcorrscan.utils.plotting import peaks_plot
    from obspy import UTCDateTime
    data = np.random.randn(200)
    data[30]=100
    data[60]=40
    threshold = 10
    peaks = findpeaks.find_peaks2_short(data, threshold, 3)
    peaks_plot(data=data, starttime=UTCDateTime("2008001"),
               samp_rate=10, peaks=peaks)