-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate legend entries for histplot #3115
Comments
It appears that there is an issue with how the plots are being created. In e.g.
Later in lines 566-582, the
If you remove the If you trace down the issue, it has to do with how This code in particular
Seems to be the issue in that the It looks like fixing this will require redesign of how the plot object is built? It looks like a lot of work was done in Matplotlib on the function calls that Seaborn is interfacing with in Matplotlib. In version 0.12.1 it appears that I tried poking around to fix the issue, but I had trouble keeping on top of how objects were being passed around to come up with a solution that does not break other types of distribution plots. |
Observed behavior
When creating a
histplot
with a legend, duplicate labels show up in the legend. It seems to be creating entries in the legend for more than oneBarContainer
artist.Expected behavior
A single entry in the legend for the histogram. In my use case, this histogram is part of a collection of overlaid plots on the same axes, and the legend is required so that the various plot artists are clearly labeled.
Minimal example
Outputs from minimal example
Version
Version where behavior is observed: 0.12.1
This behavior was not present in 0.11.2.
The text was updated successfully, but these errors were encountered: