|
From: Poul R. <Pou...@sk...> - 2012-10-14 18:32:35
|
Even worse now:
Running the program below now results in the following error message:
Traceback (most recent call last):
File "C:\pr\python\spiral.py", line 11
spiralplot =
visualgraph.curve(color=visualgraph.crayola.magenta,display=spiralgraph)
File "C:\Python32\lib\site-packages\vis\primitives.py", line 82, in
__init__
if not _other: self.init_defaults(keywords)
File "C:\Python32\lib\site-packages\vis\primitives.py", line 175, in
init_defaults
self.material = self.display.material
AttributeError: 'gdisplay' object has no attribute 'material'
import visual.graph as visualgraph
from time import *
from math import *
spiralgraph=visualgraph.gdisplay(title='Spiral', ytitle='x', xtitle='y',
x=0, y=0,
width=800, height=800,
foreground=visualgraph.color.black,
background=visualgraph.color.white)
spiralplot =
visualgraph.curve(color=visualgraph.crayola.magenta,display=spiralgraph)
spiralplot.plot(pos=(-15,-15))
spiralplot.plot(pos=(15,-15))
spiralplot.plot(pos=(15,15))
spiralplot.plot(pos=(-15,15))
spiralplot.plot(pos=(-15,-15))
for i in range(0,3600):
t=pi*i/360
x=t*cos(t)
y=t*sin(t)
spiralplot.plot(pos=(x,y))
sleep(0.001)
Poul Riis
|