|
From: Poul R. <Pou...@sk...> - 2007-01-24 17:15:03
|
The example below gives a strange curve on my computer. Apart from strange
(more or less systematic) variations there is a clear tendency that
plotting 500 points takes longer and longer time during the run. That's
another reason why I ask for a kind of 'clear points' command. How can I
change the program so that repeatingly plotting 500 points on the same
graph takes approximately the same time?
Yours,
Poul Riis
from time import *
from visual.graph import *
graph = gdisplay(title='Plotting 500 points several times',x=0, y=0,
width=600, xmin=0, xmax=500, height=100,foreground=color.black,
background=color.white)
countbar = ghbars(delta=10,color=color.blue)
countdot= gdots(color=color.red)
graph1 = gdisplay(title='Time used to plot 500 points',x=0, y=100,
width=600, xmin=0, xmax=100, height=800,foreground=color.black,
background=color.white)
timegraph=gdots(color=color.red)
jmax=500
countbar.plot(pos=(jmax,5))
for i in range(1,100):
if (i/2)*2==i:
countdot.color=color.red
else:
countdot.color=color.green
t1=clock()
for j in range(1,jmax+1):
countdot.plot(pos=(j,5))
t2=clock()
timegraph.plot(pos=(i,t2-t1))
|