0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

TkInterでmatplotlib.pyplotを使用したときにプログラムが終了しない不具合

Posted at

プログラムが正常終了しない

以下のプログラムを実行したときに,表示されたウィンドウを閉じてもプログラムが終了しないという不具合が発生しました.

min.py
import tkinter
import matplotlib.pyplot as plt

root = tkinter.Tk()

plt.figure()
# ... グラフを表示するための処理

root.mainloop()

解決策

plt.close()を追加

solution.py
import tkinter
import matplotlib.pyplot as plt

root = tkinter.Tk()

plt.figure()
# ... グラフを表示するための処理
plt.close()

root.mainloop()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?