plot_fit_result
- pmrf.viz.plot_fit_result(result: FitResult, features: str | list[str] | Evaluator = 's', ax=None, subplots: bool = False, use_data_prefix: bool | None = None, model_frequency: Frequency | None = None, **fig_kwargs)
Plots the fit results comparing measured data and the fitted model.
- Parameters:
result (FitResult) – The result object containing the fitted model, original data, and base frequency.
features (str | list[str] | Evaluator, optional) – The features to evaluate and plot. Can be a string (e.g., ‘s’), a list of strings, or a custom Evaluator object. Defaults to ‘s’.
ax (matplotlib.axes.Axes, optional) – An existing Axes object to plot on. If None, a new figure and axes are created.
subplots (bool, optional) – If True and multiple features are evaluated (e.g., multi-port S-parameters), plots them in a dynamic grid of subplots. Defaults to False.
use_data_prefix (bool | None, optional) – If True, prefixes feature titles with the name of the data network. If None, this is automatically set to True when using a NetworkCollection.
model_frequency (skrf.Frequency | None, optional) – An optional frequency object to evaluate the model against. If provided, the model will be simulated and plotted at these frequencies, while the measured data will still be plotted at result.frequency. Useful for extrapolating or smoothing the model plot. Defaults to None (uses result.frequency).
**fig_kwargs (dict) – Additional keyword arguments passed to plt.subplots() when creating a new figure.
- Returns:
fig (matplotlib.figure.Figure) – The matplotlib figure containing the plot.
axes (matplotlib.axes.Axes or numpy.ndarray) – The axes or array of axes used for the plot.