Fernando Perez wrote:
> On 4/6/07, Darren Dale <[EMAIL PROTECTED]> wrote:
>> On Friday 06 April 2007 04:37:46 pm Fernando Perez wrote:
>>> import sys
>>> import numpy as N
>>> import pylab as P
>>>
>>> print "Numpy version:",N.__version__
>>> sys.stdout.flush()
>>>
>>> P.imshow(N.ones((4,4),dtype=N.uint8))
>>> P.show()
>> Yep, I also see it, with svn 3163. It looks like the problem is only with the
>> uint8 data type, I cant reproduce it with any other types.
>
uint8 is treated very differently from anything else:
def set_data(self, A, shape=None):
"""
Set the image array
ACCEPTS: numeric/numarray/PIL Image A"""
# check if data is PIL Image without importing Image
if hasattr(A,'getpixel'): X = pil_to_array(A)
else: X = ma.asarray(A) # assume array
if (typecode(X) != UInt8
or len(X.shape) != 3
or X.shape[2] > 4
or X.shape[2] < 3):
cm.ScalarMappable.set_array(self, X)
else:
self._A = X
self._imcache =None
and
def make_image(self, magnification=1.0):
if self._A is None:
raise RuntimeError('You must first set the image array or
the image attribute')
if self._imcache is None:
if typecode(self._A) == UInt8:
im = _image.frombyte(self._A, 0)
im.is_grayscale = False
else:
so presumably _image.frombyte is what is choking. It looks like you
want colormapping, but that uint8 is serving as a flag incorrectly
indicating that you are passing in some special pre-made image type instead.
Eric
> Yup. I'm trying to work around the crash in the original code by
> recasting to some other type, but no luck so far...
>
> John: my build scripts always do a full clean, so I'm pretty sure that
> it's not picking up stray extensions. They remove all traces of the
> previous build as well as the currently installed code...
>
> Cheers,
>
> f
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Matplotlib-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel