calamari.plot.plot_boundary#

calamari.plot.plot_boundary(fit, *, ax=None, band=True, which='stat', **style)#

Draw a fit_boundary() model over the points it was fitted to.

Points, curve and band go in the H-T plane’s fixed orientation – temperature on x, mu0 H in Tesla on y, as draw_map() renders a map – with each point’s location on its own axis. A T-swept fit (T_K at held H_T) draws horizontal error bars and the curve T(H); an H-swept fit (H_T at held T_K) draws vertical error bars and the curve H(T). So it composes onto a map: plot_boundary(bf, ax=mesh.axes) after plot_chi_map() or plot_moment_map() with a 'linear' or 'log' family scale. An 'index' map places sweeps on rows, not at their field or temperature, so it is refused.

The curve and its band span the used points’ held range and no further (band): beyond the points the curve is the assumed form speaking. To draw it there, evaluate band_at() and plot that yourself, where the figure’s code says so.

What is drawn: every used point, filled, with the error the fit was weighted by (the statistical error for which='stat', statistical and systematic in quadrature for 'total'), labelled with the criterion and the number of sweeps; every excluded point hollow, with the same kind of error bar, labelled 'excluded by caller'; the curve, labelled with the model and the criterion; and, with band=True, the 1-sigma band on the model. Sweeps without a point get no marker, because there is nothing to place: they are the rows of fit.sweeps whose status is neither 'used' nor 'excluded by caller', and the model’s value there is in their predicted_* column. A failed fit draws the points and no curve.

Parameters:
  • fit (BoundaryFit) – From fit_boundary().

  • ax (Axes | None) – Draw into these axes; omitted, a new single-axes figure is created.

  • band (bool) – Draw the 1-sigma band on the model. Default True.

  • which (str) – The fit with statistical errors (default), or the one with statistical and systematic errors in quadrature (fit.total, present only when yerr_sys was given).

  • **style (Any) – Forwarded to ax.plot for the curve. The points and the band take the curve’s colour, so color= restyles all three.

Return type:

Axes

Returns:

matplotlib.axes.Axes – The axes drawn into. Axis labels are set only where the axes have none, so a map’s own labels stay. There is no legend() call (PL-1); every artist carries a label for one.

Raises:

PlotInputError – For which not 'stat' or 'total'; 'total' on a fit made without systematic errors; and axes whose label marks an 'index' map. Every refusal comes before anything is drawn.