Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Figure does not close until script finishes execution #11861

Closed
@adamjstewart

Description

@adamjstewart

Bug report

Bug summary

I have a script that loads some data, plots it, and then trains a machine learning model. When I manually try to close the figure window, the script continues, but the figure remains open until the script finishes execution.

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt
import time

x = np.arange(5)
y = np.arange(5)

plt.plot(x, y)
plt.show()

time.sleep(30)

Actual outcome

When I try to close the figure window, it remains open until the entire script finishes execution.

Expected outcome

When I close the figure window, the figure should disappear immediately.

Matplotlib version

  • Operating system: macOS 10.13.6 (High Sierra)
  • Matplotlib version: 2.2.3 (conda)
  • Matplotlib backend: MacOSX
  • Python version: 3.6.5 (conda)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions