Skip to content

Commit

Permalink
FIX: catplot with redundant hue assignment creates empty legend with …
Browse files Browse the repository at this point in the history
…title #3537
  • Loading branch information
abdulwaheedsoudagar committed Oct 30, 2023
1 parent d4ec331 commit 0a023ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions seaborn/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -3102,8 +3102,10 @@ def catplot(
y_value = p.variables.get("y")
# Obtaining the datatype of hue
hue_type = p.var_types.get("hue")
if legend == 'auto' and hue_value in {x_value, y_value} and hue_type != 'numeric':
# Setting the title of hue to None if hue matches "x" or "y", or if the data type of "hue" is numeric.
if legend == 'auto' and hue_value in {x_value, y_value} \
and hue_type != 'numeric':
# Setting the title of hue to None if hue matches "x" or
# "y", or if the data type of "hue" is numeric.
title_hue = None
else:
title_hue = hue_value
Expand Down

0 comments on commit 0a023ff

Please sign in to comment.