[SciPy-user] image_module

Karshi scipy-user@scipy.net
Fri Mar 1 04:36:40 CST 2002


Hi Eric,

I couldn't get the CVS version of scipy work, and had go back to
the version 0.1.
The following code works:
-----------------------------------------------------------------
from Numeric import *
import gui_thread
from scipy import plt
from scipy import *

Img = zeros((256,256), Float32)

for i in arange(256):
    for j in arange(256):
        r = sqrt(pow(i-128,2)+pow(j-128,2))
        
        if r <= 60:
            Img[i,j]= 100

#plt.image(Img)

x = arange(0,5)
y = special.j1(x)
plt.plot(x,y)

plt.image(Img)
plt.grid('off')
--------------------------------------------------------------------
But if I take below lines out :
x = arange(0,5)
y = special.j1(x)
plt.plot(x,y)
----------------
It will give me errors like this:
>>> 
Traceback (most recent call last):
  File "/home/Study/Matlab/Sphere.py", line 15, in ?
    plt.image(Img)
  File "/usr/local/lib/python2.1/site-packages/scipy/plt/interface.py", line 
427, in image
    axis('equal')
  File "/usr/local/lib/python2.1/site-packages/scipy/plt/interface.py", line 
174, in axis
    x_ticks = _active.x_axis.ticks
AttributeError: axis_window instance has no attribute 'ticks'
-------------------------------------------------------------
I don't understand why ?



More information about the SciPy-user mailing list