I’m trying to visualize a numpy array using imshow() since it’s similar to imagesc() in Matlab.
imshow(random.rand(8, 90), interpolation='nearest')
The resulting figure is very small at the center of the grey window, while most of the space is unoccupied. How can I set the parameters to make the figure larger? I tried figsize=(xx,xx) and it’s not what I want. Thanks!

If you don’t give an
aspectargument toimshow, it will use the value forimage.aspectin yourmatplotlibrc. The default for this value in a newmatplotlibrcisequal.So
imshowwill plot your array with equal aspect ratio.If you don’t need an equal aspect you can set
aspecttoautowhich gives the following figure
If you want an equal aspect ratio you have to adapt your
figsizeaccording to the aspectwhich gives you: