Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1292295 commit 1bfe787Copy full SHA for 1bfe787
1 file changed
examples/anim_tk.py
@@ -0,0 +1,35 @@
1
+#!/usr/bin/env python2.3
2
+
3
+import matplotlib.matlab
4
+import Tkinter as Tk
5
+import matplotlib.numerix as numerix
6
7
+fig = matplotlib.matlab.figure(1)
8
+ind = numerix.arange(60)
9
+x_tmp=[]
10
+for i in range(100):
11
+ x_tmp.append(numerix.sin((ind+i)*numerix.pi/15.0))
12
13
+X=numerix.array(x_tmp)
14
+lines = matplotlib.matlab.plot(X[:,0],'o')
15
16
+manager = matplotlib.matlab.get_current_fig_manager()
17
+def updatefig(*args):
18
+ updatefig.count += 1
19
+ lines[0].set_ydata(X[:,updatefig.count%60])
20
+ manager.canvas.draw()
21
+ return updatefig.count
22
+updatefig.count=-1
23
24
25
+manager.show()
26
+import time
27
+tstart = time.time()
28
+while 1:
29
+ cnt = updatefig()
30
+ if cnt==100: break
31
32
33
34
35
+print 'elapsed', 100.0/(time.time() - tstart)
0 commit comments