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
ENH: Add legend toggle to figure options dialog box #11109
Comments
I would support this in general. |
Wow, I didn't know about |
I'd like to work on this issue. My interpretation of this feature would be to add a button to the toolbar to toggle the legend(s). My initial plan would be to set the alpha levels of the legend to 0/1 by pressing the button but there may be a better strategy. If anyone has any suggestions or corrections, do let me know. |
The legend has a |
I've got the button to work and I can use it to toggle the legend on/off. For unit tests, I'm not sure how I would go about doing them. Since I want to stay consistent, I'm not sure how the other toolbar buttons/keypresses are tested. Is there an example of how I can write the tests? What I want to do is draw a figure with a legend, click the new toolbar button/press the toggle key, and then compare the figure afterward, how would I go about doing this? |
There are some examples of interactive tests in https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/tests/test_widgets.py . The way the interactive code works is that the GUI side of things generates an "event" which is then pushed through our callback machinery. It is possible to create those same events in the tests and push them through the machinery. |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
@wuaster any progress on this? Is there a PR? |
It is worth noting that although the dialog is created as part of the test, the callback where the settings are applied is currently not tested. Hence, one can maybe not expect that it will be feasible to test this as part of the test suite. (Although of course that would be really nice, but not really related to the issue.) |
@mspacek Sorry, no there isn’t. |
Feature request
It would be nice if the user could toggle display of the legend (if any) in the figure options dialog box. Currently, it's possible to edit curve labels and regenerate the legend, but not toggle the display of the legend. This would be especially useful because sometimes the legend can obscure parts of the plot.
Apologies if this has been discussed somewhere already. I couldn't find anything here in GH issues.
Matplotlib version
print(matplotlib.get_backend())
): Qt5AggThe text was updated successfully, but these errors were encountered: