bug with imshow() for matrix?

Hi,

I'm using 0.99.1.1 of matplotlib as provided by the latest Enthought Python
Distribution. When I try to plot a matrix with pyplot.imshow() I get all
kinds of error messages, unless vmin and vmax are specified. Plotting an
array instead works. I.e.:

y=matrix('1 2 3')

imshow(y) #fails
imshow(y, vmin=1, vmax=3) #works
imshow(array(y)) #works

Is that a bug?

Cheers

···


View this message in context: http://www.nabble.com/bug-with-imshow()-for-matrix--tp26013317p26013317.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Dudel wrote:

Hi,

I'm using 0.99.1.1 of matplotlib as provided by the latest Enthought Python
Distribution. When I try to plot a matrix with pyplot.imshow() I get all
kinds of error messages, unless vmin and vmax are specified. Plotting an
array instead works. I.e.:

y=matrix('1 2 3')

imshow(y) #fails
imshow(y, vmin=1, vmax=3) #works
imshow(array(y)) #works

Is that a bug?

Cheers

I was afraid of this sort of thing cropping up with matrices. They modify basic ndarray behavior too much. I guess instead of using np.asanyarray we need to make our own input-processing function that explicitly detects matrices and converts them to ndarrays. We could call it "anysensiblearray".

Eric