SimpleFormatter

SimpleFormatter(*args, precision=6, prefix=None, suffix=None, negpos=None, zerotrim=True, **kwargs)[source]

Replicates features of AutoFormatter, but as a simpler FuncFormatter instance. This is more suitable for arbitrary number formatting not necessarily associated with any Axis instance, e.g. labelling contours.

Parameters
  • precision (int, optional) – Maximum number of digits after the decimal point.

  • prefix, suffix (str, optional) – Optional prefix and suffix for all strings.

  • negpos (str, optional) – Length-2 string that indicates suffix for “negative” and “positive” numbers, meant to replace the minus sign. This is useful for indicating cardinal geographic coordinates.

  • zerotrim (bool, optional) – Whether to trim trailing zeros. Default is rc[‘axes.formatter.zerotrim’] = True.