Customization of NavigationToolbar #348

ddale opened this Issue Jun 20, 2011 · 2 comments


None yet
3 participants

ddale commented Jun 20, 2011

Original report at SourceForge, opened Fri Dec 12 08:00:34 2008

I would like to suggest a modification of the
GTK Navigation Toolbar, in the SaveFigure option.
Unfortunately I am not capable of doing it myself.
The changes are (I thik so) in the ""
file and can be understood in the attached PDF. Both changes involve a Matplotlib function to set the
initial filename and extension. Unfortunatly I am not
capable of doing these changes in a "clean" way.

SourceForge History

  • On Fri Dec 12 08:00:34 2008, by nobody: File Added: 305041: SaveFigurerMenu.pdf

Strange that nobody answered this feature request.
I needed to predefine an initial file path and name to programatically find the saved images afterwards and implemented it for NavigationToolbar2 and the Tk backend.

If the feature request is accepted, I can suggest code for backends which support predefining an output path.

# Apps may suggest output folder and file name if save_figure() supports this
self.initialpath = ""

def set_initialpath(self, initialpath):
    self.initialpath = initialpath

# TODO: Maybe allow function arguments for initialdir/file
if self.initialpath:
    initialdir, initialfile = os.path.split(self.initialpath)
    initialdir, initialfile = None, None
fname = asksaveasfilename(
    title='Save the figure',
    filetypes = tk_filetypes,
    initialdir = initialdir,
    initialfile = initialfile,
    defaultextension = defaultextension

pelson commented Jun 5, 2012

This feature request (or something comparable) is being implemented in #908.

@rleonhardt: Thank you for taking the time to submit your patch. We are still at the reviewing stage of #908 so please feel free to get involved & make some suggestions.

pelson closed this Jun 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment