Skip to content

[Bug]: Cursor blitting produces CheckButton issue (backend-agnostic) #25670

@drws

Description

@drws

Bug summary

Whenever CheckButtons are within a plot area, the useblit=True (in a cursor for example) produces visual errors with the buttons when the mouse is within the plot area so the cursor is active. The issue seems to be backend-agnostic (confirmed in Qt5Agg and TkAgg for now).

Code for reproduction

import matplotlib, matplotlib.pyplot

checkbutton1 = False
checkbutton2 = True

figure = matplotlib.pyplot.figure()
matplotlib.pyplot.subplots_adjust(top=0.9) # no bug without this line or if margin large enough

ax = figure.add_subplot()
ax_cursor = matplotlib.widgets.Cursor(ax, useblit=True) # no bug with useblit=False

ax_settings = matplotlib.pyplot.axes([0.8, 0.8, 0.1, 0.1])
input_settings = matplotlib.widgets.CheckButtons(ax_settings, ["Set1", "Set2"], [checkbutton1, checkbutton2])

matplotlib.pyplot.show()

Actual outcome

image

Expected outcome

The check mark for Set2 is missing even though checkbutton2 = True. When the mouse leaves the area and deactivates cursor, the check mark reappears.

Additional information

No response

Operating system

GNU/Linux

Matplotlib Version

3.7.1

Matplotlib Backend

TkAgg, Qt5Agg

Python version

3.10.10

Jupyter version

no Jupyter

Installation

Linux package manager

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions