Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Calling start() multiple times on a macos timer doesn't stop the previous timer #29076

Open
Milestone
@greglucas

Description

@greglucas

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp