def svd_plot(svstreams, svalues, stachans, **kwargs):
import matplotlib.pyplot as plt<EOL>figures = []<EOL>for sval, stachan in zip(svalues, stachans):<EOL><INDENT>print(stachan)<EOL>plot_traces = [SVStream.select(station=stachan[<NUM_LIT:0>],<EOL>channel=stachan[<NUM_LIT:1>])[<NUM_LIT:0>]<EOL>for SVStream in svstreams]<EOL>fig, axes = plt.subplots(len(plot_traces), <NUM_LIT:1>, sharex=True)<EOL>if len(plot_traces) > <NUM_LIT:1>:<EOL><INDENT>axes = axes.ravel()<EOL><DEDENT>for i, tr in enumerate(plot_traces):<EOL><INDENT>y = tr.data<EOL>x = np.linspace(<NUM_LIT:0>, len(y) * tr.stats.delta, len(y))<EOL>axes[i].plot(x, y, '<STR_LIT:k>', linewidth=<NUM_LIT>)<EOL>ylab = '<STR_LIT>' % (i + <NUM_LIT:1>, round(sval[i] / len(sval), <NUM_LIT:2>))<EOL>axes[i].set_ylabel(ylab, rotation=<NUM_LIT:0>)<EOL>axes[i].yaxis.set_ticks([])<EOL>print(i)<EOL><DEDENT>axes[-<NUM_LIT:1>].set_xlabel('<STR_LIT>')<EOL>plt.subplots_adjust(hspace=<NUM_LIT:0>)<EOL>fig = _finalise_figure(fig=fig, **kwargs)  <EOL>figures.append(fig)<EOL><DEDENT>return figures<EOL>
Plot singular vectors from the :mod:`eqcorrscan.utils.clustering` routines.

One plot for each channel.

:type svstreams: list
:param svstreams:
    See :func:`eqcorrscan.utils.clustering.svd_to_stream` - these should be
    ordered by power, e.g. first singular vector in the first stream.
:type svalues: list
:param svalues:
    List of floats of the singular values corresponding to the SVStreams
:type stachans: list
:param stachans: List of station.channel

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

.. rubric:: Example

>>> from obspy import read
>>> import glob
>>> from eqcorrscan.utils.plotting import svd_plot
>>> from eqcorrscan.utils.clustering import svd, svd_to_stream
>>> wavefiles = glob.glob('eqcorrscan/tests/test_data/WAV/TEST_/*')
>>> streams = [read(w) for w in wavefiles[1:10]]
>>> stream_list = []
>>> for st in streams:
...     tr = st.select(station='GCSZ', channel='EHZ')
...     tr = tr.detrend('simple').resample(100).filter(
...        'bandpass', freqmin=2, freqmax=8)
...     stream_list.append(tr)
>>> uvec, sval, svec, stachans = svd(stream_list=stream_list)
>>> svstreams = svd_to_stream(uvectors=uvec, stachans=stachans, k=3,
...                           sampling_rate=100)
>>> svd_plot(svstreams=svstreams, svalues=sval,
...          stachans=stachans) # doctest: +SKIP

.. plot::

    from obspy import read
    import glob, os
    from eqcorrscan.utils.plotting import svd_plot
    from eqcorrscan.utils.clustering import svd, svd_to_stream
    wavefiles = glob.glob(os.path.realpath('../../..') +
                         '/tests/test_data/WAV/TEST_/*')
    streams = [read(w) for w in wavefiles[1:10]]
    stream_list = []
    for st in streams:
        tr = st.select(station='GCSZ', channel='EHZ')
        st.detrend('simple').resample(100).filter('bandpass', freqmin=5,
                                                  freqmax=40)
        stream_list.append(tr)
    svec, sval, uvec, stachans = svd(stream_list=stream_list)
    svstreams = svd_to_stream(uvectors=uvec, stachans=stachans, k=3,
                              sampling_rate=100)
    svd_plot(svstreams=svstreams, svalues=sval,
             stachans=stachans)