ImagFormatter

class pysmithchart.formatters.ImagFormatter(axes, *args, **kwargs)[source]

Bases: RealFormatter

Formatter for the imaginary axis of a Smith chart.

This formatter formats tick values for the imaginary axis by printing numbers as floats, removing trailing zeros and unnecessary decimal points, and appending “j” to indicate imaginary values. Special cases include:

  • ‘’ (empty string) for negative infinity.

  • ‘0’ for values near zero, ensuring -0 is not displayed.

Parameters:

axes (SmithAxes) – The parent SmithAxes instance associated with this formatter.

Methods Summary

__call__(x[, pos])

Format the given tick value for the imaginary axis.

Methods Documentation

__call__(x, pos=None)[source]

Format the given tick value for the imaginary axis.

Parameters:
  • x (float) – The tick value to format.

  • pos (int, optional) – The position of the tick value (ignored in this formatter).

Returns:

str

The formatted tick value as a string, with special handling for:
  • ’’ (empty string) for negative infinity.

  • ’∞’ (UTF-8 infinity symbol) for positive infinity.

  • ’0’ for values near zero.

  • Appended “j” for imaginary values.