calamari.plot.plot_mh#

calamari.plot.plot_mh(measurement, *, ax=None, sample=None, units='emu', field_unit='oe', split_branches=False, label=None, yerr=True, **style)#

Plot moment against applied field, M(H).

Points are drawn in file order, never sorted by field, so a hysteresis loop keeps its branches; split_branches=True names them (branch 1 (up), …) as separate legend entries – see moment_series(). Field is plotted in Oe (the native unit) unless field_unit='tesla' asks for mu0 H; the moment axis follows units, with the muB forms converting through sample. Error bars follow the same rules as plot_chi_vs_t().

Parameters:
  • measurement (Measurement) – The loaded file.

  • ax (Axes | None) – Draw into these axes, or omit to create a figure.

  • sample (Sample | None) – Required for units='muB_per_ion'/'muB_per_fu'.

  • units (str) – Moment axis units. Default 'emu'.

  • field_unit (str) – Field axis unit: Oe, or mu0 H in Tesla. Branches split at the same points either way. Default 'oe'.

  • split_branches (bool) – One labelled series per monotonic sweep segment. Default False.

  • label (str | None) – Legend label (branch suffixes extend it when splitting).

  • yerr (bool) – Draw error bars when available. Default True.

  • **style (Any) – Forwarded to ax.plot/ax.errorbar for every series.

Return type:

Axes

Returns:

matplotlib.axes.Axes – The axes drawn into.