Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Milestone
Description
Bug summary
When callingtimer.start(); timer.start()
on an already running timer, the previous timer should be stopped before starting a new one. On the macosx backend this causes two timers to be running under the hood.
Code for reproduction
importtimeimportmatplotlib.pyplotasplttimer=plt.figure().canvas.new_timer(interval=1000)timer.add_callback(lambda:print(f"{time.ctime()}"))timer.start()timer.start()plt.pause(2)
Actual outcome
4 prints, 2 per second
Tue Nov 5 09:07:27 2024Tue Nov 5 09:07:27 2024Tue Nov 5 09:07:28 2024Tue Nov 5 09:07:28 2024
Expected outcome
2 prints, 1 per second
Tue Nov 5 09:07:27 2024Tue Nov 5 09:07:28 2024
Additional information
No response
Operating system
macos
Matplotlib Version
main
Matplotlib Backend
macosx
Python version
No response
Jupyter version
No response
Installation
None