Suresh Pillai wrote: > I guess I didn't read the following carefully: > > "... The aspect ratio of the figure window is that of the array > ... Because of how matshow() tries to > set the figure aspect ratio to be the one of the array, ..." > > which would explain the behaviour below. > > Why the restrictions? Seems one would want to put colorbars, etc in the > same figure and so why not behave like imshow() which it calls to make the > output. And why the new figure (so no possibility of subplots or > overlays)? Just curious ... I guess I will use imshow() directly and > modify the axes as suggested before to get the output looking like > matshow() >
Suresh, I think the general answer to your questions is "historical accident". Matshow was contributed a long time ago, and has been updated only minimally to take into account changes made elsewhere. There was even a suggestion that it might not be needed any more, but I think that it can continue to be useful and is worth updating to be an axes method, etc. This is on my growing mental list of things to do, and is probably one of the easier ones. Eric > Cheers, > Suresh > > On Thu, 8 Mar 2007, Suresh Pillai wrote: > >> If one inserts a colorbar after using matshow, then the matrix plot's aspect >> ratio is incorrect altered. Here are 2 cases to compare >> >> import pylab >> matrix = pylab.rand(30,30) >> >> 1) matshow() before colorbar() >> >> pylab.matshow(matrix) >> pylab.colorbar() >> pylab.show() >> >> The matrix plot is squished in the x-direction while not in the y thus >> losing >> its proper aspect ratio (equal by default). >> >> 2) imshow() before colorbar() >> >> pylab.imshow(matrix) >> pylab.colorbar() >> pylab.show() >> >> Everthing is okay in this case. >> >> >> Thanks, >> Suresh >> >> > > ------------------------------------------------------------------------- > 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-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------- 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-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users