animation.py: Stop event sources instead of nulling them on animation stop by DavidVadnais · Pull Request #32296 · matplotlib/matplotlib · GitHub
Skip to content

animation.py: Stop event sources instead of nulling them on animation stop - #32296

Open
DavidVadnais wants to merge 1 commit into
matplotlib:mainfrom
DavidVadnais:fix-issue-#30622
Open

animation.py: Stop event sources instead of nulling them on animation stop#32296
DavidVadnais wants to merge 1 commit into
matplotlib:mainfrom
DavidVadnais:fix-issue-#30622

Conversation

@DavidVadnais

@DavidVadnais DavidVadnais commented Sep 4, 2026

Copy link
Copy Markdown

PR summary

Closes: 30622
Followed issue link to #30590. Then followed suggestions made there.

code to exercise this change

import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation

fig, ax = plt.subplots()
anim = FuncAnimation(fig, lambda f: [], frames=3, repeat=False)
anim._start()
while anim._step():
    pass
anim.event_source 

Output before change

None

Output after change

print(anim.event_source)
<matplotlib.backend_bases.TimerBase at 0x...>

AI Disclosure

Used ai to help me find an easy issue to try and dip my toe in the water. Then had it write the exercising code.

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • Plotting related features are demonstrated in an example
  • New features and API changes have release notes
  • Documentation complies with general and docstring guidelines

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

@DavidVadnais

Copy link
Copy Markdown
Author

I think i need to add a file to doc/api/next_api_changes/behavior/ named something like animation_stop_event_stop_not_null.rst explaining this change.

@DavidVadnais

Copy link
Copy Markdown
Author

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant