MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _non_decade_format

Method _non_decade_format

lib/matplotlib/ticker.py:1197–1205  ·  view source on GitHub ↗

Return string for non-decade locations.

(self, sign_string, base, fx, usetex)

Source from the content-addressed store, hash-verified

1195 """
1196
1197 def _non_decade_format(self, sign_string, base, fx, usetex):
1198 """Return string for non-decade locations."""
1199 b = float(base)
1200 exponent = math.floor(fx)
1201 coeff = b ** (fx - exponent)
1202 if _is_close_to_int(coeff):
1203 coeff = round(coeff)
1204 return r'$\mathdefault{%s%g\times%s^{%d}}$' \
1205 % (sign_string, coeff, base, exponent)
1206
1207
1208class LogitFormatter(Formatter):

Callers

nothing calls this directly

Calls 1

_is_close_to_intFunction · 0.85

Tested by

no test coverage detected