On Thu, Jul 19, 2007 at 03:31:26PM -0700, Christopher Barker wrote: > > In matplotlib, the plot functions are matplotlib.axes.Axes methods and > > I think there is consensus that this is a poor design. > > Well, the OO interface has always felt a bit clunky to me, but I'm not > sure where else plot functions could go -- I'd love to hear ideas, though.
With a few primitives (add_artist, set_property, get_property, x/y axis, labels, grids), all of the plot types can be implemented identically outside of the axes class. Most of them are implemented that way already, and only need to change ax.plot to plot(self=ax). Default to gca() and you have pylab. > > Also, everything should be numpy enabled, > > and the sequence-of-python-tuples approach that many of the > > collections take should be dropped. > > who hoo! > > However, numpy doesn't handle "ragged" arrays well. I wonder if there's > a good way to implement those, so that transforms can be done > numpy-efficient. Can you do it with simple vectors, and an index vector indicating where the different objects start? The transformations can run simply through the sets of indices without bothering about object boundaries. The path objects can use vector slices, which IIRC, are simply views into the vectors and don't require copying the data. It would be easy enough to hide this in a class so that it acts like a sequence of lines to the caller. - Paul ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel