From: John H. <jdh...@ac...> - 2005-03-05 02:43:58
|
>>>>> "Humufr" == Humufr <hu...@ya...> writes: Humufr> Hi, when I wrote a script like: Humufr> import numarray image = numarray.ones((30,30)) Humufr> from pylab import * matshow(image) show() Humufr> I obtain an error message: Humufr> Traceback (most recent call last): File "test.py", line 6, Humufr> in ? matshow(image) File Humufr> "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", Humufr> line 1647, in matshow w,h = figaspect(arr) File Humufr> "/usr/lib/python2.4/site-packages/matplotlib/figure.py", Humufr> line 480, in figaspect nr,nc = arr.shape[:2] Humufr> AttributeError: 'module' object has no attribute 'shape' Humufr> if I'm call pylab before to create the numarray array it's Humufr> ok: It looks like your numerix setting is your .matplotlibrc file may be Numeric, and you are trying to pass a Numeric array. Make sure that the rc setting agrees with the actual array type used. To insure this, we recommend that you use matplotlib.numerix to import the array object and methods, rather than explicitly importing numarray directly. matplotlib numerix, and by extension the pylab module, already provide the proper array packages based on your rc setting. Please see several FAQs on this issue regarding rc and numerix. JDH |