Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5258ec0 commit f38b1c9Copy full SHA for f38b1c9
lib/matplotlib/tests/test_axes.py
@@ -3073,6 +3073,21 @@ def test_hist_emptydata():
3073
ax.hist([[], range(10), range(10)], histtype="step")
3074
3075
3076
+def test_hist_labels():
3077
+ # test singleton labels OK
3078
+ fig, ax = plt.subplots()
3079
+ l = ax.hist([0, 1], label=0)
3080
+ assert l[2][0].get_label() == '0'
3081
+ l = ax.hist([0, 1], label=[0])
3082
3083
+ l = ax.hist([0, 1], label=None)
3084
+ assert l[2][0].get_label() == '_nolegend_'
3085
+ l = ax.hist([0, 1], label='0')
3086
3087
+ l = ax.hist([0, 1], label='00')
3088
+ assert l[2][0].get_label() == '00'
3089
+
3090
3091
@image_comparison(baseline_images=['transparent_markers'], remove_text=True)
3092
def test_transparent_markers():
3093
np.random.seed(0)
0 commit comments