solarwindpy.TeXlabel

class TeXlabel(mcs0, mcs1=None, axnorm=None, new_line_for_units=False, description=None)[source]

Bases: Base

Create a LaTeX label from measurement, component and species information.

The object can be used directly in plotting routines. String representation returns the formatted label with units.

Notes

Comparison operators and hashing use str() of the object so two labels representing the same quantity compare equal.

__init__(mcs0, mcs1=None, axnorm=None, new_line_for_units=False, description=None)[source]

Instantiate the label.

Parameters:
  • mcs0 (tuple of str) – ("M", "C", "S") where m is the measurement, c the component and s the species. Empty strings are allowed for components or species.

  • mcs1 (tuple of str or None, optional) – Denominator for fraction style labels. Units are compared and set to dimensionless when equal.

  • axnorm ({"c", "r", "t", "d"}, optional) – Axis normalization used when building colorbar labels.

  • new_line_for_units (bool, default False) – If True a newline separates label and units.

  • description (str or None, optional) – Human-readable description displayed above the mathematical label.

property mcs0
property mcs1
property new_line_for_units
property tex
property units
property with_units
property path
property axnorm
set_mcs(mcs0, mcs1)[source]
set_new_line_for_units(new)[source]
set_axnorm(new)[source]
make_species(pattern)[source]

Basic substitution of any species within a species string if the.

species has a substitution in the ion_species dictionary.

Notes

This equation might only work because \(a\rightarrow\alpha\) is the only actual translation made and, based on lexsort order, would be the first group. This function may need to be updated for more complex patterns, e.g., if we translate something like \(\mathrm{He}^{2+}\rightarrow\text{He}^{2+}\).

build_label()[source]

Construct the complete label.

property description

Optional human-readable description shown above the label.

property logger
set_description(new)

Set the description string.

Parameters:

new (str or None) – Human-readable description. None disables the description.