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

Method __call__

lib/matplotlib/ticker.py:1490–1503  ·  view source on GitHub ↗

Return the format for tick value *x* at position *pos*. If there is no currently offset in the data, it returns the best engineering formatting that fits the given argument, independently.

(self, x, pos=None)

Source from the content-addressed store, hash-verified

1488 )
1489
1490 def __call__(self, x, pos=None):
1491 """
1492 Return the format for tick value *x* at position *pos*.
1493
1494 If there is no currently offset in the data, it returns the best
1495 engineering formatting that fits the given argument, independently.
1496 """
1497 if len(self._locs) == 0 or self.offset == 0:
1498 return self.fix_minus(self.format_data(x))
1499 else:
1500 xp = (x - self.offset) / (10. ** self._orderOfMagnitude)
1501 if abs(xp) < 1e-8:
1502 xp = 0
1503 return self._format_maybe_minus_and_locale(self._format, xp)
1504
1505 def set_locs(self, locs):
1506 # docstring inherited

Callers

nothing calls this directly

Calls 3

format_dataMethod · 0.95
fix_minusMethod · 0.80

Tested by

no test coverage detected