I am creating an interactive figure using matplotlib.
The data given as input is computed in real time and the function used to create the figure is called when the data is ready to be drawn, so I can not use the animation module. Apart from this, new data is not presented in the same axes as previous one and the output figure includes 3d plotting and gui widgets.
Every time data is drawn, I call plt.pause(30), if the user wants to interact with the output. When 30 seconds have passed, figures are updated.
What I am trying to do is to create a gui button that, when pressed, will cancel plt.pause and unblock the program execution. Till now I have not been able to find an answer to this simple (?) inquiry. Does anyone know if there is a way to stop plt.pause() from GUI, by binding it somehow to a gui widget? If not, is there a way to bypass this situation?