calamari.plot.axis_labels#

calamari.plot.axis_labels(quantity, units)#

Return the axis-label text for a (quantity, units) pair.

The one home for every label string calamari’s plot functions use, so the same physical quantity is always labelled identically regardless of which helper produced the plot.

Parameters:
  • quantity (str) – One of 'field', 'moment', 'temperature', 'chi'. Case-insensitive.

  • units (str) – The unit/variant for that quantity: 'oe'/'tesla' for 'field'; 'emu'/'muB_per_ion'/'muB_per_fu' for 'moment'; 'k' for 'temperature'; 'real'/'imag' for 'chi'. Matched case-sensitively first (so the mixed-case 'muB_per_ion'/'muB_per_fu' unit spellings used elsewhere in calamari – e.g. plot_mh()’s units parameter – pass through unchanged), falling back to a case-insensitive match.

Return type:

str

Returns:

str – Axis-label text, using matplotlib mathtext where a symbol warrants it.

Raises:

PlotInputError – If (quantity, units) names no known label.