[SciPy-user] drawing time
Johannes Broedel
johannesbroedel at gmx.de
Thu Mar 13 13:26:25 EST 2003
Hallo,
thanks for the short progrma, trying ade my computer producing the
following message (IPython):
In [7]: run sciptest.py
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
/home/jbroedel/python/graphtest/sciptest.py
5 xplt.hold('on')
6 for xval in x:
7 yval = sin(xval / 4)
----> 8 xplt.plot(xval, yval, 'x')
9 xplt.pause(100)
/home/python/PYTHON/lib/python2.2/site-packages/scipy/xplt/Mplot.py in
plot(x, *args, **keywds)
480 y = scipy.real(y)
481 y = where(scipy.isfinite(y),y,0)
--> 482
gist.plg(y,x,type=thetype,color=thecolor,marker=themarker,marks=tomark,width=linewidth)
483
484 nowplotting = nowplotting + 1
MemoryError:
WARNING: Failure executing file: <sciptest.py>
The real problem I had was with the following program:
#!/usr/bin/env python
from Numeric import *
from scipy.xplt import *
def standard_map(x_cor,y_cor,kappa):
"""provide one interate of the inital conditions x_cor,y_cor
for the standard map with parameter kappa.
"""
y_cor_new=(y_cor-kappa*sin(2.0*pi*x_cor) )% 1
x_cor_new=(x_cor+y_cor_new ) % 1
return(x_cor_new,y_cor_new)
if __name__ == '__main__':
window() # initialize plotting
limits(0.0,1.0,0.0,1.0)
x,y=0.5,0.1 # initial (x,y)
k=1.1/(2.0*pi) # parameter
animate(0)
iterations=1000
while 1: # iterate initial conditions
for i in range(iterations):
(x,y)=standard_map(x,y,k)
plg(array([y]),array([x]),type="none",marks=1,marker=1)
ch=mouse(-1,0,"press mouse button")
x,y=ch[0],ch[1]
if(ch[9]==3): break # mouse key 3
plg(array([y]),array([x]))
Sorry, I didn't manage to try the other solutions you proposed, tomorrow
I will, thanks for now, a solution for the small program would be very
nice..
Tahnk you in advance, Johannes
More information about the SciPy-User
mailing list