funct1.gcurve.pos=[]
without it, the graph wont refresh the old curve (the old plot wouldn't be erased)
from __future__ import division, print_function
from visual import *
from visual.graph import *
import wx
L = 400
H = 200
w = window(width=2*(L+window.dwidth), height=L+window.dheight+window.menuheight+H,
menus=True, title='Widgets',
style=wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX)
funct1 = gcurve(color=color.cyan)
p = 0.
while True:
rate(100)
funct1.gcurve.pos=[]
for t in arange(-30, 74, 1):
funct1.plot( pos=(t, 5.0+5.0*cos(-0.2*t-p)*exp(0.015*t)) )
p = p + 0.1
if p >100:
p = 0
.
No comments:
Post a Comment