File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -417,6 +417,15 @@ def plot1d(
417
417
cat_ax = self .axes [overlay ]
418
418
cats = cat_ax if cat_ax .traits .discrete else np .arange (len (cat_ax .centers ))
419
419
d1hists = [self [{overlay : cat }] for cat in cats ]
420
+ if 'label' in kwargs and hasattr (kwargs ['label' ], 'len' ):
421
+ if not isinstance (kwargs ['label' ], str ) and len (kwargs ['label' ]) == len (cats ):
422
+ cats = kwargs ['label' ]
423
+ kwargs .pop ("label" )
424
+ elif isinstance (kwargs ['label' ], str ):
425
+ cats = [kwargs ['label' ]] * len (cats )
426
+ kwargs .pop ("label" )
427
+ else :
428
+ raise ValueError (f"label ``{ kwargs ['label' ]} `` not understood for { len (cats )} categories" )
420
429
return plot .histplot (d1hists , ax = ax , label = cats , ** _proc_kw_for_lw (kwargs ))
421
430
422
431
def plot2d (
You can’t perform that action at this time.
0 commit comments