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


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