You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Regression: Setting alpha on legend handle changes patch color #21966
As for the previous workaround, calling set_facecolor(get_facecolor()) before calling set_alpha() works. I'm using legend.get_patches() here instead of iterating through the handles directly, but there's no difference.
On Wed, Dec 15 2021, Jody Klymak wrote:
The test in #11703 is still in the code base and passing, so I'm not
sure how this could still be a bug. Can you reproduce w/o pandas?
I briefly tried also the original code, but plt.hist() doesn't have this
issue. A simple line plot also seems to work.
This is the shortest repro I came up after reducing it.
Of note, is that pandas didn't change (using 1.3.4).
Is it something subtle about the difference between setting the handles
and the patches? It should be the same.
No, as written, they behave the same. I happened to use get_patches() in
this case, but I tested both.
This seems like someone who is familiar with what pandas does w their legend needs to help sort this out. I would suggest opening with them if there is no native matplotlib repo?
I do not expect them to be doing anything fancy, I think we just need to look at what the class of Artist is being used in the plot and what the type of the Artist in the handler is.
I suspect we are just going to discover that there is another class that needs update_from updated.
Has nothing to do with pandas, can reproduce it with mpl without pandas. I found the culprit. Will make a PR after checking if this issues shows some else too.
Activity
jklymak commentedon Dec 15, 2021
The test in #11703 is still in the code base and passing, so I'm not sure how this could still be a bug. Can you reproduce w/o pandas?
Is it something subtle about the difference between setting the handles and the patches? It should be the same.
wavexx commentedon Dec 15, 2021
jklymak commentedon Dec 15, 2021
This seems like someone who is familiar with what pandas does w their legend needs to help sort this out. I would suggest opening with them if there is no native matplotlib repo?
tacaswell commentedon Dec 15, 2021
I do not expect them to be doing anything fancy, I think we just need to look at what the class of
Artistis being used in the plot and what the type of theArtistin the handler is.I suspect we are just going to discover that there is another class that needs
update_fromupdated.StefRe commentedon Dec 19, 2021
Has nothing to do with pandas, can reproduce it with mpl without pandas. I found the culprit. Will make a PR after checking if this issues shows some else too.