On 3/19/07, Eric Firing <[EMAIL PROTECTED]> wrote:

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

Sounds good to me.

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

Yes.  In fact, others have pointed the annoying mis-feature of
old-matshow where the figure is squeezed if you add for example a
colorbar.

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

I honestly don't remember clearly why that was put in.  John and I had
some brief discussion about it, but in practice I don't think I've
ever actually used it.  So follow your judgment on this one, I have no
opinion.

Keep in mind that I wrote matshow() strictly as a quick hack to get
some functionality I needed badly (properly scaled display of matrices
with labeling along the top/left like 'normal' matrices).  I knew so
little about the internals of mpl that it's no surprise the code has
problems, so by all means feel free to improve it and modify it so it
actually fits better with the overall architecture.  I'm sure we'll
all benefit from such a cleanup.

Cheers,

f

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