def spec_trace(traces, cmap=None, wlen=<NUM_LIT>, log=False, trc='<STR_LIT:k>', tralpha=<NUM_LIT>,<EOL>size=(<NUM_LIT:10>, <NUM_LIT>), fig=None, **kwargs):
import matplotlib.pyplot as plt<EOL>if isinstance(traces, Stream):<EOL><INDENT>traces.sort(['<STR_LIT>', '<STR_LIT>'])<EOL><DEDENT>if not fig:<EOL><INDENT>fig = plt.figure()<EOL><DEDENT>for i, tr in enumerate(traces):<EOL><INDENT>if i == <NUM_LIT:0>:<EOL><INDENT>ax = fig.add_subplot(len(traces), <NUM_LIT:1>, i + <NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>ax = fig.add_subplot(len(traces), <NUM_LIT:1>, i + <NUM_LIT:1>, sharex=ax)<EOL><DEDENT>ax1, ax2 = _spec_trace(tr, cmap=cmap, wlen=wlen, log=log, trc=trc,<EOL>tralpha=tralpha, axes=ax)<EOL>ax.set_yticks([])<EOL>if i < len(traces) - <NUM_LIT:1>:<EOL><INDENT>plt.setp(ax1.get_xticklabels(), visible=False)<EOL><DEDENT>if isinstance(traces, list):<EOL><INDENT>ax.text(<NUM_LIT>, <NUM_LIT>, "<STR_LIT>".format(tr.id, tr.stats.starttime),<EOL>bbox=dict(facecolor='<STR_LIT>', alpha=<NUM_LIT>),<EOL>transform=ax2.transAxes)<EOL><DEDENT>elif isinstance(traces, Stream):<EOL><INDENT>ax.text(<NUM_LIT>, <NUM_LIT>, tr.id,<EOL>bbox=dict(facecolor='<STR_LIT>', alpha=<NUM_LIT>),<EOL>transform=ax2.transAxes)<EOL><DEDENT>ax.text(<NUM_LIT>, <NUM_LIT>, str(np.max(tr.data).round(<NUM_LIT:1>)),<EOL>bbox=dict(facecolor='<STR_LIT>', alpha=<NUM_LIT>),<EOL>transform=ax2.transAxes)<EOL><DEDENT>ax.set_xlabel('<STR_LIT>')<EOL>fig.subplots_adjust(hspace=<NUM_LIT:0>)<EOL>fig.set_size_inches(w=size[<NUM_LIT:0>], h=size[<NUM_LIT:1>], forward=True)<EOL>fig.text(<NUM_LIT>, <NUM_LIT:0.5>, '<STR_LIT>', va='<STR_LIT>', rotation='<STR_LIT>')<EOL>fig = _finalise_figure(fig=fig, **kwargs)  <EOL>return fig<EOL>
Plots seismic data with spectrogram behind.

Takes a stream or list of traces and plots the trace with the spectra
beneath it.

:type traces: list
:param traces: Traces to be plotted, can be a single
    :class:`obspy.core.stream.Stream`, or a list of
    :class:`obspy.core.trace.Trace`.
:type cmap: str
:param cmap:
    `Matplotlib colormap
    <http://matplotlib.org/examples/color/colormaps_reference.html>`_.
:type wlen: float
:param wlen: Window length for fft in seconds
:type log: bool
:param log: Use a log frequency scale
:type trc: str
:param trc: Color for the trace.
:type tralpha: float
:param tralpha: Opacity level for the seismogram, from transparent (0.0) \
    to opaque (1.0).
:type size: tuple
:param size: Plot size, tuple of floats, inches
:type fig: matplotlib.figure.Figure
:param fig: Figure to plot onto, defaults to self generating.

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

.. rubric:: Example

>>> from obspy import read
>>> from eqcorrscan.utils.plotting import spec_trace
>>> st = read()
>>> spec_trace(st, trc='white') # doctest: +SKIP


.. plot::

    from obspy import read
    from eqcorrscan.utils.plotting import spec_trace
    st = read()
    spec_trace(st, trc='white')