API#

All functions are available in the top-level namespace. But are defined in submodules modules to keep the directory structure clean.

trace(traces: Union[List[Trace], Trace], *args, ax: matplotlib.axes._axes.Axes | None = None, limits: Optional[Tuple[UTCDateTime, UTCDateTime]] = None, nooffset: bool = False, colors: list = ['k', 'r', 'b'], labels: List[str] = ['Observed', 'Synthetic', 'New Synthetic'], origin_time: obspy.core.utcdatetime.UTCDateTime | None = None, lw: list | float = 1.0, ls: list | str = '-', absmax: float | None = None, normalization_type: str | int = 'all', plot_labels: bool = True, legend: bool = True, window: bool = False, windowkwargs: dict | None = None, **kwargs)[source]#

Plot a single or a list of traces.

Parameters:
tracestp.List[obspy.Trace] | obspy.Trace

obspy.Trace or list of traces

axmatplotlib.axes.Axes | None, optional

plot into existing axes, by default None

limitstp.Tuple[obspy.UTCDateTime, obspy.UTCDateTime] | None, optional

set axes limits to UTCDateTimes or floats if origin_time is given, by default None

nooffsetbool, optional

if you are comparing two traces they are automatically offset, set True if you don’t want that, by default False

colorslist, optional

list of colors for traces, has to be same length or longer than the number of traces provided, by default [‘k’, ‘r’, ‘b’]

labelstp.List[str], optional

list of colors for labels, has to be same length or longer than the number of traces provided, by default [‘Observed’, ‘Synthetic’, ‘New Synthetic’]

origin_timeobspy.UTCDateTime | None, optional

plot traces with respect to some origin time, by default None

lwlist | float, optional

line width(s) can be single float or list thereof. List has to be same length or longer than the number of traces provided, by default 1.0

lslist | str, optional

line styles(s) can be single float or list thereof. List has to be same length or longer than the number of traces provided, by default ‘-’

absmaxfloat | None, optional

normalize traces with respect to a specific absmax, by default None

normalization_typestr | int, optional

finds absmax to normalize by with respect trace with this index or with respect to ‘all’ traces, by default ‘all’

plot_labelsbool, optional

Plot trace label, absmax amplitude, by default True

legendbool, optional

plot a legend or not, by default True

windowbool, optional

plot windows if available, by default False

windowkwargsdict | None, optional

kwargs for window plotting, by default None

Returns:
matplotlib.axes.Axes

returns axes that the traces have been plotted to

Raises:
ValueError

Wrong normalization type input

ValueError
station(streams: Union[List[Stream], Stream], *args, components: str = 'ZRT', transparent_axes: bool = False, **kwargs)[source]#

Plots given set of components of stream(s). Is a wrapper around .trace() so obsplotlib.seismogram.trace(). Streams should only contain traces of a single station. Otherwise, result may be unpredictable.

Parameters:
streamstp.List[obspy.Stream] | obspy.Stream

Stream or list of Streams to compare.

componentsstr, optional

which components to plot, by default “ZRT”

Returns:
list of matplotlib.axes.Axes

Each axes contains a component. From top to bottom.