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

Function axis_test

lib/matplotlib/tests/test_category.py:161–168  ·  view source on GitHub ↗
(axis, labels)

Source from the content-addressed store, hash-verified

159
160
161def axis_test(axis, labels):
162 ticks = list(range(len(labels)))
163 np.testing.assert_array_equal(axis.get_majorticklocs(), ticks)
164 graph_labels = [axis.major.formatter(i, i) for i in ticks]
165 # _text also decodes bytes as utf-8.
166 assert graph_labels == [cat.StrCategoryFormatter._text(l) for l in labels]
167 assert list(axis.units._mapping.keys()) == [l for l in labels]
168 assert list(axis.units._mapping.values()) == ticks
169
170
171class TestPlotBytes:

Callers 8

test_plot_bytesMethod · 0.85
test_plot_numlikeMethod · 0.85
test_plot_unicodeMethod · 0.85
test_plot_xaxisMethod · 0.85
test_plot_yaxisMethod · 0.85
test_plot_xyaxisMethod · 0.85
test_update_plotMethod · 0.85

Calls 4

get_majorticklocsMethod · 0.80
_textMethod · 0.80
valuesMethod · 0.80
formatterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…