toyplot.format module

class toyplot.format.DefaultFormatter[source]

Bases: toyplot.format.Formatter

Formats data using its default string representation.

format(value)[source]
class toyplot.format.FloatFormatter(format='{:.6g}', nanshow=True)[source]

Bases: toyplot.format.Formatter

Formats floating-point values with aligned decimal points.

Parameters:
  • format (format string, optional) – Uses standard Python Format String Syntax.
  • nanshow (bool, optional) – Set to False to hide NaN values.
format(value)[source]
class toyplot.format.Formatter[source]

Bases: object

Base class for formatters - objects that compute text representations from data.

format(value)[source]

Return a text representation of the given value.

Parameters:value (value to be formatted)
Returns:
  • prefix (string) – Formatted data to be displayed before the separator.
  • separator (string) – Separator between formatted data, or empty string.
  • suffix (string) – Formatted data to be displayed after the separator, or empty string.
class toyplot.format.NullFormatter[source]

Bases: toyplot.format.Formatter

Do-nothing formatter that returns empty strings.

format(value)[source]