From: John H. <jdh...@ac...> - 2004-02-01 16:44:40
|
>>>>> "Flavio" == Flavio Codeco Coelho <fcc...@ci...> writes: Flavio> Hi John, What do you think of adding a button to the Flavio> standara toolbar allowing the plotted data to be save in Flavio> CSV format? My initial thought is this would be hard to do well. Axes can contain an arbitrary combination of lines, text and patches (of which there are many types). The lines can be different lengths. The plot can contain an arbitrary number of axes. How to export these in a meaningful way so that the code on the other side can load and use it is not clear to me. Perhaps you should write a function def line_to_csv(l, fname): # export the x and y line data to csv likewise you may want def hist_output_to_csv(args) and call these functions from your python script as necessary. Take a look at the file examples/object_picker.py (requires gtk backend), where you can select an individual line with the mouse. It wouldn't be hard to plug an export to csv function together with this picker functionality. But it seems that for the most part these are specialized use cases that may be better handled on your end by writing your own functions and subclassing the NavigationToolbar to add your own buttons (easy to do, I can provide some example code if you like) because I suspect there would be little agreement about what export functionality is desirable. Flavio> Talking about plots, I am writing a module to calculate Flavio> Kernel density estimates (a kind of continuous histogram) Flavio> would you be interested in adding it to matplotlib? Please send me the module code and some demo script and I'll take a look. I'm happy to include useful numerical and statistical code in matplotlib.mlab or wherever appropriate. Maybe a few online references where I can read about kernel density estimates too... Thanks! JDH |