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

Method _format_ticks

lib/mpl_toolkits/axisartist/grid_finder.py:159–170  ·  view source on GitHub ↗

Helper to support both standard formatters (inheriting from `.mticker.Formatter`) and axisartist-specific ones; should be called instead of directly calling ``self.tick_formatter1`` and ``self.tick_formatter2``. This method should be considered as a temporary workar

(self, idx, direction, factor, levels)

Source from the content-addressed store, hash-verified

157 self.set_transform(transform)
158
159 def _format_ticks(self, idx, direction, factor, levels):
160 """
161 Helper to support both standard formatters (inheriting from
162 `.mticker.Formatter`) and axisartist-specific ones; should be called instead of
163 directly calling ``self.tick_formatter1`` and ``self.tick_formatter2``. This
164 method should be considered as a temporary workaround which will be removed in
165 the future at the same time as axisartist-specific formatters.
166 """
167 fmt = _api.getitem_checked(
168 {1: self.tick_formatter1, 2: self.tick_formatter2}, idx=idx)
169 return (fmt.format_ticks(levels) if isinstance(fmt, mticker.Formatter)
170 else fmt(direction, factor, levels))
171
172 def get_grid_info(self, *args, **kwargs):
173 """

Callers 3

get_grid_infoMethod · 0.95
update_limMethod · 0.80
_update_gridMethod · 0.80

Calls 2

fmtFunction · 0.85
format_ticksMethod · 0.45

Tested by

no test coverage detected