FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

KeyError: 'buttons' when plotting with matplotlib / ipympl backend in Jupyter Notebook within VSCode presumably due to typo · Issue #29337 · matplotlib/matplotlib · GitHub

Repository navigation

KeyError: 'buttons' when plotting with matplotlib / ipympl backend in Jupyter Notebook within VSCode presumably due to typo #29337

Closed

Description

Using a current install of Python and notebook, matplotlib, ipympl etc. on Windows 11 within VSCode,

%matplotlib ipympl
#%matplotlib widget
import matplotlib.pyplot as plt

and

fig, ax = plt.subplots()
...
ax.plot(...)

raise KeyError: 'buttons' in c:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\matplotlib\backends\backend_webagg_core.py:295

respectively

] if event['buttons'] & mask # State *after* press/release.

Changing the key to button resolves the error (for my use case).

Activity

  1. changed the title [-]KeyError: 'buttons' when plotting with matplotlib / ipympl backend presumably due to type[/-] [+]KeyError: 'buttons' when plotting with matplotlib / ipympl backend in Jupyter Notebook within VSCode presumably due to type[/+] on Dec 17, 2024
  2. timhoffm commented on Dec 17, 2024

    Member

    I haven’t looked closer, but the code has recently been touched in #28453, and it may be a typo.

  3. rcomer commented on Dec 17, 2024

    Member

    I believe this has been addressed by matplotlib/ipympl#568

  4. ianthomas23 commented on Dec 17, 2024

    Member

    Yes, this has been fixed on the ipympl side as is in today's 0.9.5 release on PyPI. The conda-forge package isn't available yet but it will be shortly.

  5. ianthomas23 commented on Dec 17, 2024

    Member

    But before we close the issue, can @gnbl confirm what versions of packages are installed, particularly ipympl and matplotlib.

  6. gnbl commented on Dec 17, 2024

    Author

    Afk, eta 14 hrs 😁

  7. changed the title [-]KeyError: 'buttons' when plotting with matplotlib / ipympl backend in Jupyter Notebook within VSCode presumably due to type[/-] [+]KeyError: 'buttons' when plotting with matplotlib / ipympl backend in Jupyter Notebook within VSCode presumably due to typo[/+] on Dec 17, 2024
  8. gnbl commented on Dec 18, 2024

    Author

    matplotlib 3.10.0
    ipympl 0.9.4

    ...
    Successfully installed ipympl-0.9.5

    Fixed in the update! Thanks.

  9. added a commit that references this issue on Mar 27, 2025
  10. gcohn commented on May 30, 2025

    This was driving me nuts! pip install -U ipympl>0.9.5 for the win!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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


      Back | FazBrowse Home | New Git URL