4

I am creating a small application using matplotlib. Ideally, the users will only see the matplotlib UI.

I would like to allow users of the application to retrieve the data (not just a .png) using the existing save button on the matplotlib toolbar (e.g. by writing a filename with the ".csv" file extension).

Is it possible to override/extend some matplotlib function to save the plot data in a non-supported matplotlib format?

I'm interested in a solution even if I need to keep a copy of the data outside matplotlib.

I'm not interested in solutions where the data is stored in a predefined path (e.g. /tmp) or stdout.

marcmagransdeabril
  • 1,445
  • 16
  • 27
  • 1
    What do you mean by "existing save as button"? Do you mean the save button on the matplotlib toolbar? – BrenBarn Apr 08 '14 at 07:16
  • 1
    That could be tricky and may not be a good idea anyway. Users may be confused, because saving the plot is not the same as saving the data, so it would be odd to have them both in the same dialog. What you might do instead is try to add a separate button to the toolbar for saving the data. See [this question](http://stackoverflow.com/questions/12695678/how-to-modify-the-navigation-toolbar-easily-in-a-matplotlib-figure-window) for some info on that. – BrenBarn Apr 08 '14 at 18:04
  • Thanks for the tip! However, I do not see in the link you post the save dialog class name, nor the event that I should override. Where can I find this information? – marcmagransdeabril Apr 09 '14 at 20:53

0 Answers0