File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -3073,6 +3073,21 @@ def test_hist_emptydata():
3073
3073
ax .hist ([[], range (10 ), range (10 )], histtype = "step" )
3074
3074
3075
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
+ assert l [2 ][0 ].get_label () == '0'
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
+ assert l [2 ][0 ].get_label () == '0'
3087
+ l = ax .hist ([0 , 1 ], label = '00' )
3088
+ assert l [2 ][0 ].get_label () == '00'
3089
+
3090
+
3076
3091
@image_comparison (baseline_images = ['transparent_markers' ], remove_text = True )
3077
3092
def test_transparent_markers ():
3078
3093
np .random .seed (0 )
You can’t perform that action at this time.
0 commit comments