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

Function test_subsampled_ticklabels

lib/matplotlib/tests/test_axes.py:7003–7012  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7001
7002
7003def test_subsampled_ticklabels():
7004 # test issue 11937
7005 fig, ax = plt.subplots()
7006 ax.plot(np.arange(10))
7007 ax.xaxis.set_ticks(np.arange(10) + 0.1)
7008 ax.locator_params(nbins=5)
7009 ax.xaxis.set_ticklabels([c for c in "bcdefghijk"])
7010 plt.draw()
7011 labels = [t.get_text() for t in ax.xaxis.get_ticklabels()]
7012 assert labels == ['b', 'd', 'f', 'h', 'j']
7013
7014
7015def test_mismatched_ticklabels():

Callers

nothing calls this directly

Calls 8

locator_paramsMethod · 0.80
get_ticklabelsMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
set_ticksMethod · 0.45
set_ticklabelsMethod · 0.45
drawMethod · 0.45
get_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…