On Thu, Mar 18, 2010 at 6:39 PM, John Hunter <jdh2...@gmail.com> wrote:
> I also think the name should be changed, and there should be an entry > in the matplotlib.figure.Figure API. One additional suggestion is > "subarray" and matplotlib.pyplot.subarray would be a thin wrapper to > matplotlib.figure.Figure.add_subarray. The former would return (fig, > axarray) using gcf() to get the current figure, and the latter would > simply create the subarray and return it. The would break a bit with > the pyplot "axes" and "subplot" commands that only return the Axes and > Subplot instances (and not the implicit Figure instance created/used) > but I can live with that because part of the goal here is to give easy > access to axes and figure creation so the user can get in the habit of > using the API directly for most things. > > As for the other name suggestions, I like "subplots". Without further feedback, I went with John's vote on 'subplots' and have committed the changes to the API as agreed, now naming it plt.subplots(). I'm sorry but I didn't implement the full Figure.add_subarray() changes you suggested, ran out of time... There is, however, a fly in the ointment: while this new code feels very nice from playing wtih it in scripts like the example just committed: http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/examples/pylab_examples/subplots_demo.py?revision=8202&view=markup it is NOT pleasant to use interactively, because the OO api requires explicit draw() calls all the time. I just realized this now using it more, and it's a bummer, because it makes it less likely that one will use this type of code in everyday interactive exploration. I wonder if it's possible to put things like a draw_if_interactive() call at the end of the OO methods... I realize that pyplot was the only one meant to do that, but if we are to encourage using the OO api more, then it's going to have to be as pleasant to use as pyplot... I don't know the codebase well enough to mess with this right now, so I hope someone who's more versed in that part of the code can make a fix for this whose impact isn't too severe on the runtime of OO code. Cheers, f ps - Chris, thanks for the encouragement :) ------------------------------------------------------------------------------ Download Intel® 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