8000 NavigationToolbar2Tk save_figure function bug · Issue #14602 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
NavigationToolbar2Tk save_figure function bug #14602
Closed
@k1moradi

Description

@k1moradi

There is no guarantee that canvas having a manager attribute, which was exactly what happened in my case.

fname = tkinter.filedialog.asksaveasfilename(
master=self.canvas.manager.window,
title='Save the figure',
filetypes=tk_filetypes,
defaultextension=defaultextension,
initialdir=initialdir,
initialfile=initialfile,
)

I suggest the following change to fix the problem.

fname = tkinter.filedialog.asksaveasfilename(
master=self.canvas._master,
title='Save the figure',
filetypes=tk_filetypes,
defaultextension=defaultextension,
initialdir=initialdir,
initialfile=initialfile,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0