code: def interev_mag(times, mags, size=(10.5, 7.5), **kwargs):
      import matplotlib.pyplot as plt
      info = [(times[i], mags[i]) for i in range(len(times))]
      info.sort(key=lambda tup: tup[0])
      times = [x[0] for x in info]
      mags = [x[1] for x in info]
      fig, axes = plt.subplots(1, 2, sharey=True, figsize=size)
      axes = axes.ravel()
      pre_times = []
      post_times = []
      for i in range(len(times)):
          if i > 0:
              pre_times.append((times[i] - times[i - 1]) / 60)
          if i < len(times) - 1:
              post_times.append((times[i + 1] - times[i]) / 60)
      axes[0].scatter(pre_times, mags[1:])
      axes[0].set_title('Pre-event times')
      axes[0].set_ylabel('Magnitude')
      axes[0].set_xlabel('Time (Minutes)')
      plt.setp(axes[0].xaxis.get_majorticklabels(), rotation=30)
      axes[1].scatter(pre_times, mags[:-1])
      axes[1].set_title('Post-event times')
      axes[1].set_xlabel('Time (Minutes)')
      axes[0].autoscale(enable=True, tight=True)
      axes[1].autoscale(enable=True, tight=True)
      plt.setp(axes[1].xaxis.get_majorticklabels(), rotation=30)
      fig = _finalise_figure(fig=fig, **kwargs)
      return fig