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

Function scale_range

lib/matplotlib/ticker.py:2052–2060  ·  view source on GitHub ↗
(vmin, vmax, n=1, threshold=100)

Source from the content-addressed store, hash-verified

2050
2051
2052def scale_range(vmin, vmax, n=1, threshold=100):
2053 dv = abs(vmax - vmin) # > 0 as nonsingular is called before.
2054 meanv = (vmax + vmin) / 2
2055 if abs(meanv) / dv < threshold:
2056 offset = 0
2057 else:
2058 offset = math.copysign(10 ** (math.log10(abs(meanv)) // 1), meanv)
2059 scale = 10 ** (math.log10(dv / n) // 1)
2060 return scale, offset
2061
2062
2063class _Edge_integer:

Callers 1

_raw_ticksMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…