Test whether locator marks subs to be labeled.
(self, axis, subs=())
| 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): |
no test coverage detected