I'm running Python 3.9.7 with Matplotlib 3.4.3 and Tkinter 8.6 on macOS Big Sur Version 11.6.
When I use a Tkinter file dialog and then call plt.show() in Matplotlib, my previously destroyed file dialog reappears. This is an unresolved past issue. Minimum example below.
Why is the file dialog reappearing?
What can I do to get rid of it?
import tkinter as tk
from tkinter import filedialog
import matplotlib.pyplot as plt
root = tk.Tk() # generate window for file dialog
root.withdraw()
imagePath = filedialog.askopenfilename() # select image file from file dialog
root.destroy() # clear file dialog window
plt.plot([i for i in range(4)], [2*j for j in range(4)])
plt.show()