On Thu, Feb 18, 2010 at 8:02 AM, John Hunter <jdh2...@gmail.com> wrote:
> Yes, you should know better by now than to propose a minor enhancement....

And you should know by know common sense has somehow been amputated
from my system :)

> Another thought about the interface.  How about *just* returning the
> figure instance, and let the users simply index into the axes list.
> Then they can have their 0 based indexing because it is a python
> list::
>
>  fig =  fig_subplot((2,1), sharex=1)
>  fig.axes[0].plot(...)
>  fig.axes[1].scatter(...)
>
> mpl is creating this axes list anyway....  I'm also fine with your
> implementation -- just a suggestion.

Mmh, doubting: the more compact api is appealing, but in actual use it
seems to make for a lot of typing, since the really useful objects for
most things are the axes. Given that in python3 we'll have more
flexible unpacking:

Python 3.1.1 (r311:74480, Sep 18 2009, 19:43:55)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = list(range(10))
>>> x, y, *z = a
>>> x, y, z
(0, 1, [2, 3, 4, 5, 6, 7, 8, 9])
>>> m, *n, p, q = a
>>> m, n, p, q
(0, [1, 2, 3, 4, 5, 6, 7], 8, 9)

makes me lean towards keeping the [fig, ax1, ax2...] notation.  But
I'm willing to reconsider on further arguments.


> One other thing: I don't think a tuple is best for the axes
> dimensionality.  We always require two and exactly two shape arguments
> (numrows, numcols) so we don't need the flexibility of the tuple in
> the way that numpy.zeros does.  And it is easier to type::
>
>  fig_subplot(2, 1, sharex=1)
>
> than::
>
>  fig_subplot((2,1), sharex=1)
>
> As the world master of keystroke efficiency, I would think you would
> appreciate the savings!  But again, if you prefer the tuple, I don't
> have a problem with it.  It does have the advantage of visually
> suggesting a single shape argument.
>

+1 for the (nr, nc, share...) form.

I won't have time to work on this for a couple of days though; keep
further  feedback coming, I should be back home on Monday and  able to
finish it (I'm away on a teaching-sprint-within-a-teaching-marathon
for a couple of days).  If anyone wants to finish it first, run with
it., I'm not personally attached to it.

Cheers,

f

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to