<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def peaks_plot(data, starttime, samp_rate, peaks=[(0, 0)], **kwargs):
 """ 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 .. 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) """

    import matplotlib.pyplot as plt
    npts = len(data)
    t = np.arange(npts, dtype=np.float32) / (samp_rate * 3600)
    fig = plt.figure()
    ax1 = fig.add_subplot(111)
    ax1.plot(t, data, 'k')
    ax1.scatter(peaks[0][1] / (samp_rate * 3600), abs(peaks[0][0]),
                color='r', label='Peaks')
    for peak in peaks:
        ax1.scatter(peak[1] / (samp_rate * 3600), abs(peak[0]), color='r')
    ax1.legend()
    ax1.set_xlabel("Time after %s [hr]" % starttime.isoformat())
    ax1.axis('tight')
    fig.suptitle('Peaks')
    fig = _finalise_figure(fig=fig, **kwargs)  # pragma: no cover
    return fig