Fernando Perez wrote:
[...]
> Frankly, I don't care how it's done: I wrote matshow long ago, back
> when axis('scaled') didn't exist in the first place.  If the same
> result can be achieved by other means that are cleaner, I'm sure John
> will accept a patch.

One of the matshow anomalies is that it is a pylab function only instead 
of a wrapper for an Axes method, so I made a new Axes.matshow(), and a 
temporary matshow1() pylab function that calls it.  Differences between 
matshow() and matshow1():

1) The latter labels the *centers* of the squares representing the 
matrix elements, starting from zero.  Tick values are consequently integers.

2) matshow1 uses the same function as matshow (figaspect()) to determine 
the window dimensions, but keeps the matrix elements square when they 
would be stretched in matshow.  I can change this back to the matshow 
behavior if desired.

> 
> All I need regularly in my work is the ability to plot a matrix such
> that both the axis AND the enclosing figure (which determines the size
> of the resulting EPS files for publications or talks) have the aspect
> ratio of the actual matrix.  How that result is achieved is really
> immaterial to me.

I suspect that what you would actually prefer is better automated figure 
sizing so that it would always nicely enclose the axes with their 
labels, titles, etc., correct?  There is nothing magic about having the 
actual aspect ratio of the figure exactly match that of the axes box?
(Not that I can easily achieve the nice wrapping result--this is just to 
clarify the ideal.)

> 
> matshow does what I need so I use it, but I have no particular
> attachment to the code other than the fact that it happens to work
> correctly.  That's a bonus in my book.

Absolutely!

Another anomaly of matshow (presently preserved in matshow1) is the 
returnall kwarg; this seems like the sort of thing that should either be 
supported by all pylab functions, or by none.  The argument for none is 
that one can easily use gcf() and gca() to get the other two arguments. 
  Do you want to keep the returnall kwarg?

Eric

-------------------------------------------------------------------------
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

Reply via email to