plotting.plot_complex_matrix

plotting.plot_complex_matrix(
    matrices,
    freqs,
    *,
    names=None,
    labels=None,
    row_labels=None,
    col_labels=None,
    edges=None,
    entries=None,
    layout='auto',
    x_title='$f\\;(\\mathrm{Hz})$',
    phase='rad',
    unwrap=False,
    mag_range=None,
    title=None,
    height=None,
    width=None,
    showlegend=None,
)

Plot the magnitude and phase of every (selected) entry of a complex matrix.

Parameters

Name Type Description Default
matrices array or list of arrays One (n_freq, N, N) complex stack (or several, overlaid) and the matching frequency axis (or one shared axis). required
freqs array or list of arrays One (n_freq, N, N) complex stack (or several, overlaid) and the matching frequency axis (or one shared axis). required
names list of str Legend names, one per overlaid matrix. None
labels sequence of str Per-index variable symbols (e.g. ("f", "g", "h")) shared by both axes. Defaults to characteristic symbols by size, else 1-based indices. None
row_labels sequence of str Per-axis labels, overriding labels/edges. Entry (i, j) is titled col_labels[j] -> row_labels[i] (input column -> output row). None
col_labels sequence of str Per-axis labels, overriding labels/edges. Entry (i, j) is titled col_labels[j] -> row_labels[i] (input column -> output row). None
edges tuple of (a, b) Subscript the column variables by the input edge a and the row variables by the output edge b, so a transfer-matrix entry reads f_a -> f_b instead of the ambiguous f -> f. None
entries list of (i, j) Restrict to these entries (default: all N*N). None
layout (auto, flat, grid) "flat" = one strip (mag row over phase row); "grid" = matrix-shaped cells. "auto" picks flat for N <= 2, grid otherwise. "auto"
phase (rad, deg) Phase unit; magnitude is always linear. "rad"
unwrap bool Unwrap the phase along frequency (off by default, so the wrapped phase sits in a fixed band). False
mag_range tuple of (lo, hi) Fixed magnitude y-range applied to every entry. Default None anchors each entry at 0 and scales to its own peak. None

Returns

Name Type Description
plotly.graph_objects.Figure The assembled magnitude-over-phase figure.
Back to top