The code is supposed to wait for user click, then it will close the plot and continue. This works great when not done from the tkinter loop, but if the plot function is invo