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
[Bug]: Macosx legend picker doesn't work anymore #22760
Comments
Confirmed that this is broken on v3.5.1 with 'macosx'. Note that it works fine for 'qt5agg'. However, running on master this runs fine, so I suspect a recent macOS fix here, maybe @greglucas or @dstansby knows what was fixed. Thanks for the report, however, this should be fixed in v3.6 (unfortunately not in the bug fix release 3.5.2, due out soon) |
I don't see anything immediately obvious in 3.5.x that would cause this looking through the difference. The issue is with requesting a redraw. After clicking to remove the line and then resizing the window, you can see the change did happen it just didn't show up. Additionally, changing |
Is the issue that the pick event never fires or that the update is not being reflected? If you resize the window (which unconditionally causes a full redraw because we need a different number of pixels!) do the changes get reflected correctly? If so then I think @greglucas 's explanation of what is wrong / why it works on main is correct. If not, then please put some prints in the callback to make sure the events are actually firing (and if they are not that is very worrying). |
I'm going to close this issue as fixed on main and will be in the upcoming 3.6 release. There is also a reasonable workaround (using |
Bug summary
I used to be able to use a legend picker as described in this matplotlib tutorial.
It doesn't work anymore. I bet it was an up
Code for reproduction
Actual outcome
It graphs fine, but I can't toggle visibility by clicking the legend.
I've tried executing the code from my Mac Terminal and from an IDE (Spyder) with Python 3.8.12 and matplotlib version 3.5.1.
Expected outcome
I should be able to click and toggle the visibility.
Additional information
Legend picking with this script still works from my other Spyder app, which has python 3.9.2 and matplotlib 3.3.4.
Operating system
macOS Monterey
Matplotlib Version
3.5.1
Matplotlib Backend
MacOSX
Python version
3.8.12
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered: