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

Method _sub_labels

lib/matplotlib/tests/test_ticker.py:1231–1239  ·  view source on GitHub ↗

Test whether locator marks subs to be labeled.

(self, axis, subs=())

Source from the content-addressed store, hash-verified

1229 assert fmt.format_data_short(value) == short
1230
1231 def _sub_labels(self, axis, subs=()):
1232 """Test whether locator marks subs to be labeled."""
1233 fmt = axis.get_minor_formatter()
1234 minor_tlocs = axis.get_minorticklocs()
1235 fmt.set_locs(minor_tlocs)
1236 coefs = minor_tlocs / 10**(np.floor(np.log10(minor_tlocs)))
1237 label_expected = [round(c) in subs for c in coefs]
1238 label_test = [fmt(x) != '' for x in minor_tlocs]
1239 assert label_test == label_expected
1240
1241 @mpl.style.context('default')
1242 def test_sublabel(self):

Callers 1

test_sublabelMethod · 0.95

Calls 4

fmtFunction · 0.85
get_minor_formatterMethod · 0.80
get_minorticklocsMethod · 0.80
set_locsMethod · 0.45

Tested by

no test coverage detected