calamari.plot.plot_fit#

calamari.plot.plot_fit(x, result, *, ax=None, n_dense=400, label=None, **style)#

Overlay a fitted model curve.

Evaluates result (see calamari.fitting) on a dense, evenly spaced grid spanning the range of x and plots it – the usual “smooth curve through scattered data” overlay. Does not touch axis labels or limits, so it composes cleanly onto axes a preceding plot_* call has already labelled.

Parameters:
  • x (ArrayLike) – The x-data the fit was performed over (or any range to evaluate the model across); only min(x)/max(x) are used.

  • result (FitResult) – A fit result from calamari.fitting.fit, evaluated via curve().

  • ax (Axes | None) – The axes to overlay on – usually the return value of the plot_* call that drew the data.

  • n_dense (int) – Number of points in the dense evaluation grid. Default 400.

  • label (str | None) – Legend label.

  • **style (Any) – Forwarded to ax.plot.

Return type:

Axes

Returns:

matplotlib.axes.Axes – The axes drawn into.