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

Method __call__

lib/matplotlib/dates.py:922–940  ·  view source on GitHub ↗
(self, x, pos=None)

Source from the content-addressed store, hash-verified

920 self._locator = locator
921
922 def __call__(self, x, pos=None):
923 try:
924 locator_unit_scale = float(self._locator._get_unit())
925 except AttributeError:
926 locator_unit_scale = 1
927 # Pick the first scale which is greater than the locator unit.
928 fmt = next((fmt for scale, fmt in sorted(self.scaled.items())
929 if scale >= locator_unit_scale),
930 self.defaultfmt)
931
932 if isinstance(fmt, str):
933 self._formatter = DateFormatter(fmt, self._tz, usetex=self._usetex)
934 result = self._formatter(x, pos)
935 elif callable(fmt):
936 result = fmt(x, pos)
937 else:
938 raise TypeError(f'Unexpected type passed to {self!r}.')
939
940 return result
941
942
943class rrulewrapper:

Callers

nothing calls this directly

Calls 3

DateFormatterClass · 0.85
fmtFunction · 0.85
_get_unitMethod · 0.45

Tested by

no test coverage detected