Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #97292
| From | Laura Creighton <lac@openend.se> |
|---|---|
| Subject | Re: matplotlib timer |
| References | <3unq0b1qkisbudlj03q4qlu5t5ugpmo0th@4ax.com> |
| Date | 2015-10-01 19:28 +0200 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.304.1443720523.28679.python-list@python.org> (permalink) |
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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
matplotlib timer Dave Farrance <df@see.replyto.invalid> - 2015-10-01 17:36 +0100
Re: matplotlib timer Laura Creighton <lac@openend.se> - 2015-10-01 19:28 +0200
Re: matplotlib timer Dave Farrance <df@see.replyto.invalid> - 2015-10-01 18:45 +0100
Re: matplotlib timer Laura Creighton <lac@openend.se> - 2015-10-01 20:09 +0200
Re: matplotlib timer Dave Farrance <df@see.replyto.invalid> - 2015-10-01 20:03 +0100
Re: matplotlib timer Laura Creighton <lac@openend.se> - 2015-10-01 21:19 +0200
Re: matplotlib timer Dave Farrance <df@see.replyto.invalid> - 2015-10-01 20:47 +0100
Re: matplotlib timer Laura Creighton <lac@openend.se> - 2015-10-01 22:01 +0200
csiph-web