I have a script as follows that executes on my windows machine
import matplotlib.pyplot as plt
import numpy as np
import tkinter
class main(tkinter.Frame): #main window
def __init__(self, root): # initialise
tkinter.Frame.__init__(self)
self.root = root
tkinter.Button(self, text='New spots', command=self.newSpots).grid()
def newSpots(self):
x = np.random.rand(10)
y = np.random.rand(10)
plt.scatter(x,y)
plt.show()
if __name__=='__main__':
root = tkinter.Tk()
app = main(root).grid()
root.mainloop()
When running on windows, it opens a window with a simple button, and clicking this button opens a matplotlib viewer with 10 dots plotted in random positions. Each subsequent press of the button adds a further ten dots.
Executing this code on a mac produces the same initial window, and the first press of the button generates the plot and opens the viewer as expected. However, it then becomes impossible to interact with the original window (only the controls on the viewer work) until the viewer window is closed. How do I make the behaviour on the mac mirror that on the windows machine?