I\'m running Python v3.5
and matplotlib v1.4.3
on Windows 10 Home
. Up to recently, I write the python script using matplotlib
I stumbled on a similar problem. This is because your matplotlib figure and your PyQt GUI are both running in the same main thread. Since they are in the main thread, only one of them has the CPU for itself.
I have tried to solve the problem by putting either the PyQT GUI or the matplotlib inside another thread. But that doesn't work. Both PyQT and matplotlib need to run in the main thread.
So here is a workaround. You can start the matplotlib figure from a newly created python shell:
import subprocess
...
# When you click the button in your PyQT GUI,
# Create a new process:
myMatProcess = subprocess.Popen(['python', 'myGraph.py'], shell=True)
Now your PyQT GUI and the matplotlib figure you're drawing have their own python interpreter shell. And they can run smoothly without blocking each other.
If you have any further questions, don't hesitate to ask. I'd be happy to help you out.