DieformattersAPI
formatters API Referenz¶
-
class
probscale.formatters.PctFormatter[Quelle]¶ Bases:
probscale.formatters._FormatterMixinFormatter-Klasse für MPL-Achsen zur Anzeige von Wahrscheinlichkeiten als Prozentsätze.
Beispiele
>>> from probscale import formatters >>> fmt = formatters.PctFormatter() >>> fmt(0.2) '0.2' >>> fmt(10) '10' >>> fmt(99.999) '99.999'
-
factor= 1.0¶
-
offset= 2¶
-
top= 100¶
-
-
class
probscale.formatters.ProbFormatter[Quelle]¶ Bases:
probscale.formatters._FormatterMixinFormatter-Klasse für MPL-Achsen zur Anzeige von Wahrscheinlichkeiten als Dezimalzahlen.
Beispiele
>>> from probscale import formatters >>> fmt = formatters.ProbFormatter() >>> fmt(0.01) '0.01' >>> fmt(0.2) '0.20' >>> try: ... fmt(10.5) ... except(ValueError): ... print('formatter out of bounds') formatter out of bounds
-
factor= 100.0¶
-
offset= 0¶
-
top= 1¶
-