sysplot.plot_stem#

plot_stem(x, y, ax=None, label=None, bottom=0.0, marker='o', markersize=None, show_baseline=True, directional_markers=False, continous_baseline=False, **kwargs)[source]#

Plot vertical stems with optional outward-pointing markers.

Wraps Axes.stem with automatic style cycling. When directional_markers=True, stems above bottom use marker and stems below use its directional opposite from FLIPPED_MARKERS (e.g., ^ becomes v).

Note

Use marker="^" together with directional_markers=True to get outward-pointing arrows on both sides of the baseline.

Parameters:
  • x (ndarray) – X-coordinates of the stems.

  • y (ndarray) – Y-values. Must have the same length as x.

  • ax (Axes | None) – Axes to plot on. Defaults to the current axes.

  • label (str | None) – Legend label. Applied to the above-baseline stems only.

  • marker (str) – Matplotlib marker style for stems at or above bottom.

  • bottom (float) – Baseline value. Default is 0.

  • markersize (float | None) – Marker size. Defaults to markersize.

  • show_baseline (bool) – If True, draw and style the baseline.

  • directional_markers (bool) – If True, flip the marker for stems below bottom. Requires marker to be in FLIPPED_MARKERS.

  • continous_baseline (bool) – If True, draw extend the baseline with axhline. Requires show_baseline=True.

  • **kwargs

    Additional keyword arguments forwarded to matplotlib.axes.Axes.stem().

    If color or linestyle are not provided, they are taken from the active sysplot style cycler and applied consistently to markers, stem lines, and baseline.

Return type:

tuple[list, list, list]

Returns:

Tuple of (markerlines, stemlines, baselines) — each a list of 1 or 2 objects depending on whether directional_markers was used.

Examples using sysplot.plot_stem#

Plot Stem

Plot Stem

Quick Start Example

Quick Start Example