def interev_mag(times, mags, size=(<NUM_LIT>, <NUM_LIT>), **kwargs):
import matplotlib.pyplot as plt<EOL>info = [(times[i], mags[i]) for i in range(len(times))]<EOL>info.sort(key=lambda tup: tup[<NUM_LIT:0>])<EOL>times = [x[<NUM_LIT:0>] for x in info]<EOL>mags = [x[<NUM_LIT:1>] for x in info]<EOL>fig, axes = plt.subplots(<NUM_LIT:1>, <NUM_LIT:2>, sharey=True, figsize=size)<EOL>axes = axes.ravel()<EOL>pre_times = []<EOL>post_times = []<EOL>for i in range(len(times)):<EOL><INDENT>if i > <NUM_LIT:0>:<EOL><INDENT>pre_times.append((times[i] - times[i - <NUM_LIT:1>]) / <NUM_LIT>)<EOL><DEDENT>if i < len(times) - <NUM_LIT:1>:<EOL><INDENT>post_times.append((times[i + <NUM_LIT:1>] - times[i]) / <NUM_LIT>)<EOL><DEDENT><DEDENT>axes[<NUM_LIT:0>].scatter(pre_times, mags[<NUM_LIT:1>:])<EOL>axes[<NUM_LIT:0>].set_title('<STR_LIT>')<EOL>axes[<NUM_LIT:0>].set_ylabel('<STR_LIT>')<EOL>axes[<NUM_LIT:0>].set_xlabel('<STR_LIT>')<EOL>plt.setp(axes[<NUM_LIT:0>].xaxis.get_majorticklabels(), rotation=<NUM_LIT:30>)<EOL>axes[<NUM_LIT:1>].scatter(pre_times, mags[:-<NUM_LIT:1>])<EOL>axes[<NUM_LIT:1>].set_title('<STR_LIT>')<EOL>axes[<NUM_LIT:1>].set_xlabel('<STR_LIT>')<EOL>axes[<NUM_LIT:0>].autoscale(enable=True, tight=True)<EOL>axes[<NUM_LIT:1>].autoscale(enable=True, tight=True)<EOL>plt.setp(axes[<NUM_LIT:1>].xaxis.get_majorticklabels(), rotation=<NUM_LIT:30>)<EOL>fig = _finalise_figure(fig=fig, **kwargs)  <EOL>return fig<EOL>
Plot inter-event times against magnitude.

:type times: list
:param times: list of the detection times, must be sorted the same as mags
:type mags: list
:param mags: list of magnitudes
:type size: tuple
:param size: Size of figure in inches.

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

.. rubric:: Example

>>> from obspy.clients.fdsn import Client
>>> from obspy import UTCDateTime
>>> from eqcorrscan.utils.plotting import interev_mag
>>> client = Client('IRIS')
>>> t1 = UTCDateTime('2012-03-26T00:00:00')
>>> t2 = t1 + (3 * 86400)
>>> catalog = client.get_events(starttime=t1, endtime=t2, minmagnitude=3)
>>> magnitudes = [event.preferred_magnitude().mag for event in catalog]
>>> times = [event.preferred_origin().time for event in catalog]
>>> interev_mag(times, magnitudes) # doctest: +SKIP

.. plot::

    from obspy.clients.fdsn import Client
    from obspy import UTCDateTime
    from eqcorrscan.utils.plotting import interev_mag
    client = Client('IRIS')
    t1 = UTCDateTime('2012-03-26T00:00:00')
    t2 = t1 + (3 * 86400)
    catalog = client.get_events(starttime=t1, endtime=t2, minmagnitude=3)
    magnitudes = [event.preferred_magnitude().mag for event in catalog]
    times = [event.preferred_origin().time for event in catalog]
    interev_mag(times, magnitudes)