6.2.10.12. eqcorrscan.utils.plotting.spec_trace

eqcorrscan.utils.plotting.spec_trace(traces, cmap=None, wlen=0.4, log=False, trc='k', tralpha=0.9, fig=None, **kwargs)[source]

Plots seismic data with spectrogram behind.

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

Parameters:
  • traces (list) – Traces to be plotted, can be a single obspy.core.stream.Stream, or a list of obspy.core.trace.Trace.
  • cmap (str) – Matplotlib colormap.
  • wlen (float) – Window length for fft in seconds
  • log (bool) – Use a log frequency scale
  • trc (str) – Color for the trace.
  • tralpha (float) – Opacity level for the seismogram, from transparent (0.0) to opaque (1.0).
  • fig – Figure to plot onto, defaults to self generating.
  • title (str) – Title of figure
  • show (bool) – Whether to show the figure or not (defaults to True)
  • save (bool) – Whether to save the figure or not (defaults to False)
  • savefile (str) – Filename to save figure to, if save==True (defaults to “EQcorrscan_figure.png”)
  • return_figure (bool) – Whether to return the figure or not (defaults to True), if False then the figure will be cleared and closed.
  • size (tuple of float) – Figure size as (width, height) in inches. Defaults to (10.5, 7.5)
Returns:

matplotlib.figure.Figure

Example

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

(Source code)