Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customization of NavigationToolbar #348

Closed
ddale opened this issue Jun 20, 2011 · 2 comments
Closed

Customization of NavigationToolbar #348

ddale opened this issue Jun 20, 2011 · 2 comments

Comments

@ddale
Copy link
Contributor

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 "backend_gtk.py"
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
@rleonhardt
Copy link

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.

backend_bases.py:2418

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

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

backend_tkagg.py:769

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

@pelson
Copy link
Member

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 pelson closed this as completed Jun 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants