Issues with imshow

Hello,

I am trying to use the imshow() function for a 2-dimensional array.

However, I am having issues with the following: When the array is perfectly
square the image looks like this:

http://old.nabble.com/file/p28063442/Plot2.png

but when it is not it looks like this:
http://old.nabble.com/file/p28063442/Plot.png

Is there any way I can line up the image for a rectangular array so that its
in the top left corner?

Thank you

···

--
View this message in context: http://old.nabble.com/Issues-with-imshow-tp28063442p28063442.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Hi,

I'm not really sure I get your point, but you can try to play with the
placement of the used subplot
    ``axes(rect)`` where *rect* = [left, bottom, width, height]
     in normalized (0, 1) units.
e.g.
ax = plt.axes([0.1, 0.2, 0.8, 0.6])

and with the kwargs of imshow (extent: limits of the picture and aspect : [
None | 'auto' | 'equal' | scalar ] )

e.g.
a = np.arange(35).reshape(7, 5)
ax.imshow(a, interpolation='nearest', extent=(0.0, 1.0, 0.0, 1.0),
aspect='auto', origin='lower')

Kind regards,
Matthias

···

On Monday 29 March 2010 01:51:30 Sunman wrote:

Hello,

I am trying to use the imshow() function for a 2-dimensional array.

However, I am having issues with the following: When the array is perfectly
square the image looks like this:

http://old.nabble.com/file/p28063442/Plot2.png

but when it is not it looks like this:
http://old.nabble.com/file/p28063442/Plot.png

Is there any way I can line up the image for a rectangular array so that
its in the top left corner?