SigFigFormatter

class SigFigFormatter(sigfig=3, zerotrim=None)[source]

Bases: matplotlib.ticker.Formatter

Rounds numbers to the specified number of significant digits.

Parameters
  • sigfig (float, optional) – The number of significant digits.

  • zerotrim (bool, optional) – Whether to trim trailing zeros.

Methods Summary

__call__(x[, pos])

Convert number to a string.