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

Method closeto

lib/matplotlib/ticker.py:2086–2094  ·  view source on GitHub ↗
(self, ms, edge)

Source from the content-addressed store, hash-verified

2084 self._offset = abs(offset)
2085
2086 def closeto(self, ms, edge):
2087 # Allow more slop when the offset is large compared to the step.
2088 if self._offset > 0:
2089 digits = np.log10(self._offset / self.step)
2090 tol = max(1e-10, 10 ** (digits - 12))
2091 tol = min(0.4999, tol)
2092 else:
2093 tol = 1e-10
2094 return abs(ms - edge) < tol
2095
2096 def le(self, x):
2097 """Return the largest n: n*step <= x."""

Callers 2

leMethod · 0.95
geMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected