|
From: Poul R. <Pou...@sk...> - 2007-01-22 12:40:00
|
Could someone please correct (or comment on) the following (rather
minimal) example. It runs without any error messages but there are some
unwanted lines and trying to clear a graph by putting visble=0 doesn't
work.
Yours
Poul Riis
from visual.graph import *
from math import *
from time import *
graph = gdisplay(title='Test',width=400,
height=300,foreground=color.black, background=color.white)
graphcurve= gcurve(color=color.red)
for i in range (0,360):
graphcurve.plot(pos=(i,sin(i/180.0*pi)))
sleep(0.005)
#painting the curve white, thus clearing it:
graphcurve.color=color.white
for i in range (0,360):
graphcurve.plot(pos=(i,sin(i/180.0*pi)))
sleep(0.005)
#another curve in blue:
graphcurve.color=color.blue
for i in range (0,360):
graphcurve.plot(pos=(i,cos(i/180.0*pi)))
sleep(0.005)
#Hoping to clear the blue curve...:
graphcurve.visible=0
#Redrawing the curve in green:
graphcurve.color=color.green
for i in range (0,360):
graphcurve.plot(pos=(i,cos(i/180.0*pi)))
sleep(0.005)
|