TexEngFormatter

class Stoner.plot.formats.TexEngFormatter(unit='', places=None, sep=' ', *, usetex=None, useMathText=None)[source]

Bases: EngFormatter

An axis tick label formatter that emits Tex formula mode code.

Formatting is set so that large numbers are registered as with SI prefixes rather than using E notation.

Attributes Summary

ENG_PREFIXES

axis

locs

prefix

useMathText

usetex

Methods Summary

__call__(value[, pos])

Return the value ina suitable texable format.

create_dummy_axis(**kwargs)

fix_minus(s)

Some classes may want to replace a hyphen for minus with the proper Unicode symbol (U+2212) for typographical correctness. This is a helper method to perform such a replacement when it is enabled via :rc:`axes.unicode_minus`.

format_data(value)

Return the full string representation of the value with the position unspecified.

format_data_short(value)

Return a short string version of the tick value.

format_eng(num)

Format a number in engineering notation, appending a letter representing the power of 1000 of the original number.

format_ticks(values)

Return the tick labels for all the ticks at once.

get_offset()

get_useMathText()

get_usetex()

set_axis(axis)

set_locs(locs)

Set the locations of the ticks.

set_useMathText(val)

set_usetex(val)

Attributes Documentation

ENG_PREFIXES = {-30: 'q', -27: 'r', -24: 'y', -21: 'z', -18: 'a', -15: 'f', -12: 'p', -9: 'n', -6: 'µ', -3: 'm', 0: '', 3: 'k', 6: 'M', 9: 'G', 12: 'T', 15: 'P', 18: 'E', 21: 'Z', 24: 'Y', 27: 'R', 30: 'Q'}
axis = None
locs = []
prefix = {-24: 'y', -21: 'z', -18: 'a', -15: 'f', -12: 'p', -9: 'n', -6: '\\mu', -3: 'm', 0: '', 3: 'k', 6: 'M', 9: 'G', 12: 'T', 15: 'P', 18: 'E', 21: 'Z', 24: 'Y'}
useMathText
usetex

Methods Documentation

__call__(value, pos=None)[source]

Return the value ina suitable texable format.

create_dummy_axis(**kwargs)
static fix_minus(s)

Some classes may want to replace a hyphen for minus with the proper Unicode symbol (U+2212) for typographical correctness. This is a helper method to perform such a replacement when it is enabled via :rc:`axes.unicode_minus`.

format_data(value)[source]

Return the full string representation of the value with the position unspecified.

format_data_short(value)[source]

Return a short string version of the tick value.

Defaults to the position-independent long value.

format_eng(num)

Format a number in engineering notation, appending a letter representing the power of 1000 of the original number. Some examples:

>>> format_eng(0)        # for self.places = 0
'0'
>>> format_eng(1000000)  # for self.places = 1
'1.0 M'
>>> format_eng(-1e-6)  # for self.places = 2
'-1.00 µ'
format_ticks(values)

Return the tick labels for all the ticks at once.

get_offset()
get_useMathText()
get_usetex()
set_axis(axis)
set_locs(locs)

Set the locations of the ticks.

This method is called before computing the tick labels because some formatters need to know all tick locations to do so.

set_useMathText(val)
set_usetex(val)