Skip to content

Include ability to query status of CheckButtons widget #5930

Closed
@DanHickstein

Description

@DanHickstein

Similar to the discussion of RadioButtons a few months ago (see here and here), it seems like there should be an ability to check the status of the check boxes in the CheckButtons widget.

A fairly reasonable solution was proposed in this SO post (answer from user "Grunby"), where you can just query the visibility of the lines in each checkbox. It would be fairly easy to implement this as a function within the CheckButtons class, so that users could do something like:

from matplotlib.widgets import CheckButtons
check = CheckButtons(ax1, ('a','b','c'), (True, False, True))
check.get_status()

where get_active() would return (True, False, True) in this case.

I would be happy to work on a PR. Any thoughts on exactly how this should be implemented or what the function should be called to query the status?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions