Skip to content
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

Remove workaround for matplotlib < 3.4 #577

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

ianthomas23
Copy link
Member

Fixes #575.

Workaround code for matplotlib < 3.4 was using a string check of version number:

if matplotlib.__version__ < '3.4':

which breaks using matplotlib 3.10.

It is possible to replace this with

if matplotlib.__version_info__ < (3, 4):

but __version_info__ was introduced into matplotlib at version 3.5. Anyway, we no longer support matplotlib < 3.4

"matplotlib>=3.4.0,<4",

so I have just removed the workaround in this PR, which fixes the problem locally for me.

@ianthomas23 ianthomas23 added the bug label Jan 2, 2025
Copy link
Contributor

github-actions bot commented Jan 2, 2025

Binder 👈 Launch a binder notebook on branch matplotlib/ipympl/575-remove-old-mpl-workarounds

@ianthomas23
Copy link
Member Author

Self-merging to make a release a soon as possible.

@ianthomas23 ianthomas23 merged commit 14db341 into main Jan 2, 2025
11 checks passed
@ianthomas23 ianthomas23 deleted the 575-remove-old-mpl-workarounds branch January 2, 2025 11:15
self.key_release_event(key, guiEvent=guiEvent)

handle_key_press = handle_key_release = _handle_key


class FigureManager(FigureManagerWebAgg):
if matplotlib.__version__ < "3.6":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this line not have the same issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I missed that. It doesn't seem to cause a problem though, in my manual testing.

#580 fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

key_press_event not working with matplotlib 3.10
2 participants