solarwindpy.plotting.labels
Tools for creating physical quantity plot labels.
Functions
Print all available measurement, component and species labels. |
- class TeXlabel(mcs0, mcs1=None, axnorm=None, new_line_for_units=False, description=None)[source]
Bases:
BaseCreate 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")wheremis the measurement,cthe component andsthe 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) – IfTruea newline separates label and units.description (str or None, optional) – Human-readable description displayed above the mathematical label.
- property axnorm
- build_label()[source]
Construct the complete label.
- property description
Optional human-readable description shown above the label.
- property logger
- 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+}\).
- property mcs0
- property mcs1
- property new_line_for_units
- property path
- set_axnorm(new)[source]
- set_description(new)
Set the description string.
- Parameters:
new (str or None) – Human-readable description. None disables the description.
- set_mcs(mcs0, mcs1)[source]
- set_new_line_for_units(new)[source]
- property tex
- property units
- property with_units
- class Vsw(description=None)[source]
Bases:
BaseSolar wind speed.
- __init__(description=None)[source]
Initialize the logger.
- property description
Optional human-readable description shown above the label.
- property logger
- property path
- set_description(new)
Set the description string.
- Parameters:
new (str or None) – Human-readable description. None disables the description.
- property tex
- property units
- property with_units
- class Count(norm=None, description=None)[source]
Bases:
ArbitraryLabelCount histogram label.
- __init__(norm=None, description=None)[source]
Initialize the logger.
- property axnorm
- build_label()[source]
- property description
Optional human-readable description shown above the label.
- property logger
- property path
- set_axnorm(norm)[source]
- set_description(new)
Set the description string.
- Parameters:
new (str or None) – Human-readable description. None disables the description.
- property tex
- property units
- property with_units
- species_translation(pattern)
Replace species codes in a string with their LaTeX equivalents.
- Parameters:
pattern (str) – String potentially containing species codes.
- Returns:
(new_string, count)fromre.subn().- Return type:
Notes
Only substitutions defined in
_trans_speciesare performed. The implementation relies on the simple mapping used in this module and may need to be revisited for more complex patterns.