From: Glen W. M. <Gle...@sw...> - 2007-03-02 14:45:29
|
On Fri, Mar 02, 2007 at 09:41:03AM -0500, Simon Wood wrote: > Out of the box matplotlib works great with Numeric and numarray data types. > However, I have my own custom class which contains data members, methods and > an array of data (underlying C array). Is there a way to expose the C array > data to the plot() routines? For example I would like to be able to use > plot(X) where X is an instantiated object of type MyClass. One approach that I've used recently is to simply provide functionality for the [] operator (done by implementing the __getslice__ member function) that accesses the data according to standard slicing rules. Then, you can use plot() directly. Glen |