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

Class LogFormatterSciNotation

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

Format values following scientific notation in a logarithmic axis.

Source from the content-addressed store, hash-verified

1190
1191
1192class LogFormatterSciNotation(LogFormatterMathtext):
1193 """
1194 Format values following scientific notation in a logarithmic axis.
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):

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…