map_plot¶
MATLAB equivalent:
sidMapPlot
map_plot ¶
Time-frequency colour map for sidFreqMap results.
map_plot ¶
map_plot(result: FreqMapResult, *, plot_type: str = 'magnitude', frequency_unit: str = 'rad/s', clim: tuple | None = None, ax=None) -> dict
Time-frequency colour map for :func:sid.freq_map results.
This is the Python port of sidMapPlot.m.
Plots the time-varying frequency response (or spectrum / coherence)
as a pcolormesh colour map with time on the x-axis and
frequency (log scale) on the y-axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
FreqMapResult
|
Result struct returned by :func: |
required |
plot_type
|
str
|
What to plot:
|
'magnitude'
|
frequency_unit
|
str
|
|
'rad/s'
|
clim
|
tuple of (float, float) or None
|
Colour axis limits |
None
|
ax
|
matplotlib Axes or None
|
Existing axes to plot into. If |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary with the following keys:
|
Raises:
| Type | Description |
|---|---|
SidError
|
If result is not a |
SidError
|
If plot_type requires a frequency response but the result is
time-series only (code: |
SidError
|
If plot_type is |
SidError
|
If plot_type is unrecognised (code: |
Examples:
>>> import numpy as np
>>> import sid
>>> N = 4000; u = np.random.randn(N)
>>> y = np.convolve(u, [1, -0.9])[:N] + 0.1 * np.random.randn(N)
>>> result = sid.freq_map(y, u, segment_length=512)
>>> h = sid.map_plot(result, plot_type='magnitude')
Notes
Specification: SPEC.md S6.9 -- Visualization: sidMapPlot
See Also
sid.freq_map : Time-varying frequency response estimation. sid.spectrogram_plot : Spectrogram colour map. sid.bode_plot : Static Bode diagram.
Changelog
2026-04-09 : First version (Python port) by Pedro Lourenco.