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

Method nonsingular

lib/matplotlib/ticker.py:2613–2633  ·  view source on GitHub ↗
(self, vmin, vmax)

Source from the content-addressed store, hash-verified

2611 return vmin, vmax
2612
2613 def nonsingular(self, vmin, vmax):
2614 if vmin > vmax:
2615 vmin, vmax = vmax, vmin
2616 if not np.isfinite(vmin) or not np.isfinite(vmax):
2617 vmin, vmax = 1, 10 # Initial range, no data plotted yet.
2618 elif vmax <= 0:
2619 _api.warn_external(
2620 "Data has no positive values, and therefore cannot be "
2621 "log-scaled.")
2622 vmin, vmax = 1, 10
2623 else:
2624 # Consider shared axises
2625 minpos = min(axis.get_minpos() for axis in self.axis._get_shared_axis())
2626 if not np.isfinite(minpos):
2627 minpos = 1e-300 # This should never take effect.
2628 if vmin <= 0:
2629 vmin = minpos
2630 if vmin == vmax:
2631 vmin = _decade_less(vmin, self._base)
2632 vmax = _decade_greater(vmax, self._base)
2633 return vmin, vmax
2634
2635
2636class SymmetricalLogLocator(Locator):

Callers 1

view_limitsMethod · 0.95

Calls 4

_decade_lessFunction · 0.85
_decade_greaterFunction · 0.85
_get_shared_axisMethod · 0.80
get_minposMethod · 0.45

Tested by

no test coverage detected