calamari.plot.plot_fit_windows#

calamari.plot.plot_fit_windows(scan, parameter, *, x='x_min', ax=None, **style)#

Plot one fitted parameter against the fitting window’s edge.

The picture that goes with calamari.fitting.fit_windows: <parameter> +/- <parameter>_err for every window, against the window’s lower (or upper) bound. A parameter that depends on the fitting range shows up as a trend that the error bars do not cover. Nothing here judges whether the trend matters; that stays with the caller, as it does for the scan itself. A quantity the scan derived (fit_windows(..., derived={"mu_eff": ...})) plots the same way, with its propagated error as the bar.

Failed windows are skipped visibly, not silently. A window whose fit failed (or that had no more points than free parameters) has no estimate, so it gets no point. Instead a thin grey dotted vertical line is drawn at its edge, so a gap in the series cannot be mistaken for a window that was never asked for. These lines carry no legend label and ignore **style.

Parameters:
  • scan (FitWindowsResult) – The result of fit_windows.

  • parameter (str) – A model parameter or derived-quantity name, i.e. a column of scan.table with a matching <parameter>_err column.

  • x (str) – Which window edge to plot against. Default 'x_min', the usual way to show a drift as the lower bound of the range rises.

  • ax (Axes | None) – Axes to draw into; a new figure is created when omitted.

  • **style (Any) – Forwarded to ax.errorbar for the estimates (e.g. marker, capsize, label).

Return type:

Axes

Returns:

matplotlib.axes.Axes – The axes drawn into. The x-label names the window edge and the y-label the parameter; neither knows the unit, so relabel with the physical quantity for a figure.

Raises:

PlotInputError – If x is not a window edge, or parameter is neither a parameter of the scanned model nor a quantity the scan derived.