You could probably override the matplotlib.backends.backend_wx.NavigationToolbar2.save function. If you are using pylab/pyplot, this function is accessible as
In : fig.canvas.manager.frame.toolbar.save
Out: <bound method NavigationToolbar2WxAgg.save of <matplotlib.backends.backend_wxagg.NavigationToolbar2WxAgg; proxy of <Swig Object of type ‘wxToolBar *’ at 0x3b5bc60> >>
and has the signature::
def save(self, evt):
where evt is the GUI event that generated the callback (can safely be ignored).
If you are embedding mpl in wx directly, you can create your own toolbar as in the embedding_in_wx* examples at
On Tue, Apr 28, 2009 at 8:21 AM, Thomas Robitaille <thomas.robitaille@…287…> wrote:
I was wondering if it is possible to override the ‘save’ button in
wxAgg so that once a filename has been specified in the dialog, a
custom function is run instead of the default savefig? Maybe this
would require too much hacking?