plotting.plot_transfer_matrix
plotting.plot_transfer_matrix(
matrices,
freqs,
*,
labels=None,
edges=None,
mag_range=_PRESET,
**kwargs,
)Plot a perturbation transfer matrix versus frequency (magnitude over phase).
A thin preset over :func:plot_complex_matrix: it applies the preset magnitude rule and, given the two station edges, subscripts each variable by its edge so an entry reads f₁ → f₂ (input edge a to output edge b) instead of the ambiguous f → f.
This is a display helper only – it does not change the variables the matrix is written in. Build the matrix in the variables you want first (PerturbationResponse.transfer_matrix(a, b, basis=...)); labels here only names the axes (default: characteristic symbols (f, g, h)).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| matrices | array or list of arrays | One (n_freq, N, N) complex transfer-matrix stack, or several to overlay. |
required |
| freqs | array or list of arrays | Matching frequency axis (or one shared axis) for the x-axis. | required |
| labels | sequence of str | Per-variable symbols for the axes (default: (f, g, h) by size). Set these to match the variables the matrix was built in. |
None |
| edges | tuple of (a, b) | The two station edge ids. Subscripts the input (column) variables by a and the output (row) variables by b, giving the f_a → f_b reading; without it the entries fall back to the bare f → f form. |
None |
| mag_range | tuple of (lo, hi) | Fixed magnitude y-range. By default the preset rule applies: (0, 1) when no entry exceeds unity, otherwise (0, max \|entry\|). |
_PRESET |
| **kwargs | Forwarded to :func:plot_complex_matrix (layout, phase, unwrap, x_title, names, title, height, width …). |
{} |
Returns
| Name | Type | Description |
|---|---|---|
| plotly.graph_objects.Figure |
See Also
nefes.perturbation.PerturbationResponse.plot_transfer_matrix : Method that converts the matrix to basis and labels it to match, supplying edges automatically from the station ids.
Examples
>>> T = resp.transfer_matrix(1, 2, basis="primitive") # convert here
>>> plot_transfer_matrix(T, resp.freqs, edges=(1, 2),
... labels=("p'/ρc", "u'", "ρ'c/ρ")).show()