Skip to content

Closing a plot window throws an error when in pause #16667

Closed
@Yazington

Description

@Yazington
If I'm using plot.pause(15) and I close the window while there is a pause, the window shouldn't throw an exception, instead keep the execution going

Bug report

Bug summary

Code for reproduction

# Paste your code here
#   plt.show(block=False)
    plt.pause(15)
    self.hide()
    def hide(self):
        if plt.gcf():
            plt.clf()
            plt.cla()
            plt.close()
#

Actual outcome

# If applicable, paste the console output here
#_tkinter.TclError: can't invoke "update" command: application has been destroyed
#

Expected outcome

Matplotlib version

  • Operating system:
  • Matplotlib version:
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version:
  • Jupyter version (if applicable):
  • Other libraries:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions