Jon Olav Vik <jono...@...> writes:

> Antony Lee <antony....@...> writes:
> It happens that this array has dtype=int16, and imshow's doc says that 
> it only accepts float arrays

Having looked at the example you sent me, I think what you want is .astype():


a = np.array([[24695, 19052, 0], 
       [24565, 23793, -17393],
       [ 25883, -32082, -24333]], dtype=int16)
imshow(a) # all blue
imshow(a.astype(float)) # colours! 8-)
imshow(a.astype(int)) # looks the same as using "float"
imshow(a.astype(float), interpolation="nearest") # without blurring

Hope this helps,
Jon Olav



------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to