Skip to content

Commit

Permalink
FIX mwaskom#3537 Disabling the legend based on the x-axis and hue values
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulwaheedsoudagar committed Oct 25, 2023
1 parent 863539d commit 367d588
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions seaborn/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2763,6 +2763,10 @@ def catplot(
elif x is not None and y is not None:
raise ValueError("Cannot pass values for both `x` and `y`.")

# Check for x and hue values are same
if x == hue:
legend = False

p = Plotter(
data=data,
variables=dict(x=x, y=y, hue=hue, row=row, col=col, units=units),
Expand Down

0 comments on commit 367d588

Please sign in to comment.