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 Nov 4, 2023
1 parent e32e02d commit 79dc7d5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -3125,10 +3125,14 @@ def test_invalid_kind(self, long_df):
with pytest.raises(ValueError, match="Invalid `kind`: 'wrong'"):
catplot(long_df, kind="wrong")

def test_no_legend_with_auto(self):
def test_legend_with_auto(self):

g1 = catplot(self.df, x="g", y="y", hue="g", legend='auto')
assert g1._legend is None

g2 = catplot(self.df, x="g", y="y", hue="g", legend=True)
assert g2._legend is not None

g = catplot(self.df, x="g", y="y", hue="g", legend='auto')
assert g._legend is None

class TestBeeswarm:

Expand Down

0 comments on commit 79dc7d5

Please sign in to comment.