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

Function test_hist_labels

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

Source from the content-addressed store, hash-verified

5301
5302
5303def test_hist_labels():
5304 # test singleton labels OK
5305 fig, ax = plt.subplots()
5306 _, _, bars = ax.hist([0, 1], label=0)
5307 assert bars[0].get_label() == '0'
5308 _, _, bars = ax.hist([0, 1], label=[0])
5309 assert bars[0].get_label() == '0'
5310 _, _, bars = ax.hist([0, 1], label=None)
5311 assert bars[0].get_label() == '_nolegend_'
5312 _, _, bars = ax.hist([0, 1], label='0')
5313 assert bars[0].get_label() == '0'
5314 _, _, bars = ax.hist([0, 1], label='00')
5315 assert bars[0].get_label() == '00'
5316
5317
5318@image_comparison(['transparent_markers'], remove_text=True, style='_classic_test')

Callers

nothing calls this directly

Calls 3

histMethod · 0.80
subplotsMethod · 0.45
get_labelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…