def plot_synth_real(real_template, synthetic, channels=False, size=(<NUM_LIT:5>, <NUM_LIT:10>),<EOL>**kwargs):
import matplotlib.pyplot as plt<EOL>colours = ['<STR_LIT:k>', '<STR_LIT:r>']<EOL>labels = ['<STR_LIT>', '<STR_LIT>']<EOL>if channels:<EOL><INDENT>real = []<EOL>synth = []<EOL>for stachan in channels:<EOL><INDENT>real.append(real_template.select(station=stachan[<NUM_LIT:0>],<EOL>channel=stachan[<NUM_LIT:1>]))<EOL>synth.append(synthetic.select(station=stachan[<NUM_LIT:0>],<EOL>channel=stachan[<NUM_LIT:1>]))<EOL><DEDENT>real_template = Stream(real)<EOL>synthetic = Stream(synth)<EOL><DEDENT>stachans = list(set([(tr.stats.station, tr.stats.channel)<EOL>for tr in real_template]))<EOL>fig, axes = plt.subplots(len(stachans), <NUM_LIT:1>, sharex=True, figsize=size)<EOL>if len(stachans) > <NUM_LIT:1>:<EOL><INDENT>axes = axes.ravel()<EOL><DEDENT>for i, stachan in enumerate(stachans):<EOL><INDENT>if len(stachans) > <NUM_LIT:1>:<EOL><INDENT>axis = axes[i]<EOL><DEDENT>else:<EOL><INDENT>axis = axes<EOL><DEDENT>real_tr = real_template.select(station=stachan[<NUM_LIT:0>],<EOL>channel=stachan[<NUM_LIT:1>])[<NUM_LIT:0>]<EOL>synth_tr = synthetic.select(station=stachan[<NUM_LIT:0>],<EOL>channel=stachan[<NUM_LIT:1>])[<NUM_LIT:0>]<EOL>shift, corr = xcorr(real_tr, synth_tr, <NUM_LIT:2>)<EOL>print('<STR_LIT>' + str(shift) + '<STR_LIT>')<EOL>if corr < <NUM_LIT:0>:<EOL><INDENT>synth_tr.data = synth_tr.data * -<NUM_LIT:1><EOL>corr = corr * -<NUM_LIT:1><EOL><DEDENT>if shift < <NUM_LIT:0>:<EOL><INDENT>synth_tr.data = synth_tr.data[abs(shift):]<EOL>real_tr.data = real_tr.data[<NUM_LIT:0>:len(synth_tr.data)]<EOL><DEDENT>elif shift > <NUM_LIT:0>:<EOL><INDENT>real_tr.data = real_tr.data[abs(shift):]<EOL>synth_tr.data = synth_tr.data[<NUM_LIT:0>:len(real_tr.data)]<EOL><DEDENT>for j, tr in enumerate([real_tr, synth_tr]):<EOL><INDENT>y = tr.data<EOL>y = y / float(max(abs(y)))<EOL>x = np.linspace(<NUM_LIT:0>, len(y) * tr.stats.delta, len(y))<EOL>axis.plot(x, y, colours[j], linewidth=<NUM_LIT>, label=labels[j])<EOL>axis.get_yaxis().set_ticks([])<EOL><DEDENT>ylab = stachan[<NUM_LIT:0>] + '<STR_LIT:.>' + stachan[<NUM_LIT:1>] + '<STR_LIT>' + str(round(corr, <NUM_LIT:2>))<EOL>axis.set_ylabel(ylab, rotation=<NUM_LIT:0>)<EOL><DEDENT>plt.subplots_adjust(hspace=<NUM_LIT:0>)<EOL>if len(stachans) > <NUM_LIT:1>:<EOL><INDENT>axes[-<NUM_LIT:1>].set_xlabel('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>axes.set_xlabel('<STR_LIT>')<EOL><DEDENT>fig = _finalise_figure(fig=fig, **kwargs)  <EOL>return fig<EOL>
Plot multiple channels of data for real data and synthetic.

:type real_template: obspy.core.stream.Stream
:param real_template: Stream of the real template
:type synthetic: obspy.core.stream.Stream
:param synthetic: Stream of synthetic template
:type channels: list
:param channels: List of tuples of (station, channel) to plot, default is \
        False, which plots all.
:type size: tuple
:param size: Plot size.

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

>>> from obspy import read, Stream, Trace
>>> from eqcorrscan.utils.synth_seis import seis_sim
>>> from eqcorrscan.utils.plotting import plot_synth_real
>>> real = read()
>>> synth = Stream(Trace(seis_sim(sp=100, flength=200)))
>>> synth[0].stats.station = 'RJOB'
>>> synth[0].stats.channel = 'EHZ'
>>> synth[0].stats.sampling_rate = 100
>>> synth = synth.filter('bandpass', freqmin=2, freqmax=8)
>>> real = real.select(
...    station='RJOB', channel='EHZ').detrend('simple').filter(
...       'bandpass', freqmin=2, freqmax=8)
>>> real = real.trim(
...    starttime=real[0].stats.starttime + 4.9,
...    endtime=real[0].stats.starttime + 6.9).detrend('simple')
>>> plot_synth_real(real_template=real, synthetic=synth,
...                 size=(7, 4)) # doctest: +SKIP

.. plot::

    from eqcorrscan.utils.plotting import plot_synth_real
    from obspy import read, Stream, Trace
    from eqcorrscan.utils.synth_seis import seis_sim
    import os
    real = read()
    synth = Stream(Trace(seis_sim(sp=100, flength=200)))
    synth[0].stats.station = 'RJOB'
    synth[0].stats.channel = 'EHZ'
    synth[0].stats.sampling_rate = 100
    synth.filter('bandpass', freqmin=2, freqmax=8)
    real = real.select(station='RJOB', channel='EHZ').detrend('simple').\
        filter('bandpass', freqmin=2, freqmax=8)
    real.trim(starttime=real[0].stats.starttime + 4.9,
              endtime=real[0].stats.starttime + 6.9).detrend('simple')
    plot_synth_real(real_template=real, synthetic=synth, size=(7, 4))