Path: csiph.com!goblin3!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'stops': 0.07; 'cc:addr :python-list': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'python': 0.10; 'skip:f 30': 0.15; 'thu,': 0.15; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'message-id:@fido.openend.se': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'skip:> 20': 0.16; 'ticks': 0.16; 'laura': 0.18; '2015': 0.20; 'cc:addr:python.org': 0.20; 'cc:2**1': 0.22; 'stopping': 0.22; 'trying': 0.22; 'second': 0.24; 'figure': 0.27; 'function': 0.28; 'installed,': 0.29; 'matplotlib': 0.29; 'received:se': 0.29; 'cc:no real name:2**1': 0.29; "i'm": 0.30; 'too.': 0.30; 'code': 0.30; "can't": 0.32; 'maybe': 0.33; 'getting': 0.33; 'ubuntu': 0.33; 'mine': 0.35; 'skip:> 10': 0.35; 'should': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'charset:us-ascii': 0.37; 'does': 0.39; 'header:Message-Id:1': 0.61; 'jul': 0.72; '>def': 0.84; '>if': 0.84; 'does?': 0.84; 'farrance': 0.84; 'header:In-reply-to:1': 0.84 To: DaveFarrance@yahoo.co.uk.invalid cc: python-list@python.org, lac@openend.se From: Laura Creighton Subject: Re: matplotlib timer In-reply-to: <3unq0b1qkisbudlj03q4qlu5t5ugpmo0th@4ax.com> References: <3unq0b1qkisbudlj03q4qlu5t5ugpmo0th@4ax.com> Comments: In-reply-to Dave Farrance message dated "Thu, 01 Oct 2015 17:36:50 +0100." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21997.1443720515.1@fido> Date: Thu, 01 Oct 2015 19:28:35 +0200 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [82.96.5.2]); Thu, 01 Oct 2015 19:28:37 +0200 (CEST) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1443720523 news.xs4all.nl 23749 [2001:888:2000:d::a6]:33956 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:97292 In a message of Thu, 01 Oct 2015 17:36:50 +0100, Dave Farrance writes: >I'm trying to set up the basics of a timer-scheduled function in >matplotlib and I can't figure out how to stop the timer. Maybe the >stop() method is dysfunctional in Ubuntu 14.04 or maybe I'm getting the >syntax wrong. > >If anybody's got matplotlib installed, can you try this code and tell me >if it stops after one tick as it should -- or does it continue printing >every second without stopping as mine does? > >#!/usr/bin/env python >import matplotlib.pyplot as P >def fn(): > timer.stop() > print("tick") >fig, ax = P.subplots() >timer = fig.canvas.new_timer(interval=1000) >timer.add_callback(fn) >timer.start() >P.show() > debian unstable Python 3.4.3+ (default, Jul 28 2015, 13:17:50) mine ticks forever, too. Laura