AutoFormatter¶
-
class
AutoFormatter
(*args, zerotrim=None, precision=None, tickrange=None, prefix=None, suffix=None, **kwargs)[source]¶ Bases:
matplotlib.ticker.ScalarFormatter
The new default formatter, a simple wrapper around
ScalarFormatter
. Differs fromScalarFormatter
in the following ways:Trims trailing zeros if any exist.
Allows user to specify range within which major tick marks are labelled.
Allows user to add arbitrary prefix or suffix to every tick label string.
- Parameters
zerotrim (bool, optional) – Whether to trim trailing zeros. Default is
rc[‘axes.formatter.zerotrim’]
=True
.precision (float, optional) – The maximum number of digits after the decimal point.
tickrange ((float, float), optional) – Range within which major tick marks are labelled.
prefix, suffix (str, optional) – Optional prefix and suffix for all strings.
*args, **kwargs – Passed to
matplotlib.ticker.ScalarFormatter
.
Methods Summary
__call__
(x[, pos])Convert number to a string.