plot

function of dascore.viz.annotations source

plot(
    annotations: AnnotationSet ,
    ax: matplotlib.axes._axes.Axes | None[Axes, None] = None,
    x: str | None[str, None] = None,
    y: str | None[str, None] = None,
    color: str | collections.abc.Sequence[str, collections.abc.Sequence[float], None] = None,
    label: str | None[str, None] = None,
    **style ,
)-> ‘plt.Axes’

Draw every feature of the set on an axis, e.g. over a waterfall.

Parameters

Parameter Description
annotations The set to draw.
ax The axis to draw on; one is made if None.
x, y Dimensions for the axes; default dims[-1] and dims[0], as
waterfall puts them. A one-dimensional set draws along x, or
along y when only y is named.
A set of more dimensions names both.
color A matplotlib color, or a column of either table whose values are
colored from the property cycle, with a legend. A row blank on both
tables is grey; a feature blank on both reads its first member.
label A column whose values label the artists in a legend; a blank value
is left out of it.
**style Passed to every artist, e.g. alpha; line keys such as marker
or linewidth reach only lines and markers.
Note

A row is a marker where it states a value on both axes, a line or span where it states one axis, a segment where it states a value and a range, and a box for two ranges; a row stating neither axis is not drawn. A group draws its members, a path a line per part, and a polygon a filled patch per part with its holes left empty. A path or polygon not drawn in both axes is skipped.

Examples

import pandas as pd
import dascore as dc
patch = dc.get_example_patch()
time = patch.get_coord("time").min()
picks = pd.DataFrame({"time": [time, time], "phase": ["P", "S"]})
picks["distance"] = [100.0, 200.0]
ann = dc.AnnotationSet.from_patch(patch, picks)
ax = patch.viz.waterfall()
ax = ann.viz.plot(ax=ax, color="phase")