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=Truenames them (branch 1 (up), …) as separate legend entries – seemoment_series(). Field is plotted in Oe (the native unit) unlessfield_unit='tesla'asks for mu0 H; the moment axis followsunits, with themuBforms converting throughsample. Error bars follow the same rules asplot_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 forunits='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 toax.plot/ax.errorbarfor every series.
- Return type:
- Returns:
matplotlib.axes.Axes– The axes drawn into.