Format values following scientific notation in a logarithmic axis.
| 1190 | |
| 1191 | |
| 1192 | class 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 | |
| 1208 | class LogitFormatter(Formatter): |
no outgoing calls
no test coverage detected
searching dependent graphs…