| 5301 | |
| 5302 | |
| 5303 | def 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') |