plot§

typed_lisa_toolkit.plot(obj, /, fig=None, ax=None, *, plot_mode=None, set_legend=True, **kwargs)[source]§

Plot a single object with customizable visualization options.

This function provides a unified interface for plotting various types The function automatically handles axis creation, unit normalization, and label formatting.

Parameters:
  • obj – The object to plot. Can be a representation, a data, or a waveform. Positional-only.

  • fig (matplotlib.figure.Figure, optional) – The figure to plot into. If not provided a new figure will be created.

  • ax (matplotlib.axes.Axes, optional) – The axes to plot into. If provided, fig must also be provided. Can not be specified when plotting multi-channel objects.

  • plot_mode ({'loglog', 'semilogx', 'semilogy', 'plot', 'imshow'}, optional) – The plotting mode to use. If not specified, a default mode is selected based on the object type.

  • set_legend (bool, default True) – Whether to display a legend on the plot.

  • **kwargs

    Additional keyword arguments passed to matplotlib or figure creation. Common options include:

    • Figure kwargs: figsize, dpi, constrained_layout

    • Subplot kwargs: sharex, sharey, wspace, hspace

    • Line kwargs: color, linewidth, linestyle, label

    • Image kwargs: cmap, vmin, vmax

Returns:

  • fig (matplotlib.figure.Figure) – The figure containing the plot.

  • axs (list[list[matplotlib.axes.Axes]]) – The axes containing the plot, organized as a list of rows of axes, where a row is itself a list of axes.

Raises:
  • TypeError – If obj is not a plottable type.

  • ValueError – If the object has an unsupported shape or if ax is provided without fig.

  • NotImplementedError – If obj has a sparse grid or other configuration yet to be supported.

Notes

  • Units are automatically normalized across all data in the plot for consistency and readability.

  • For TimeSeries, the time unit is automatically selected based on the duration (seconds, hours, or days).

  • For FrequencySeries and Phasor, the frequency unit is automatically selected based on the maximum frequency (Hz, kHz, or mHz).

  • When plotting multi-channel objects, subplots are created with shared axes.

See also

plot_compare()

For comparing two compatible objects.