Closed ozumana closed 4 years ago
In an IPython console, this is as simple as running %gui qt
. You can also programatically choose your backend with matplotlib.use('Qt5Agg')
before importing any plotting modules.
More information is available in the Matplotlib docs.
Hope this helps, Sam
Thank you for the simple fix... however, I note that a plt.pause command was necessary in my code to ensure that the plot live refresh was visible.
Yes, you'll need to do that if your are adding data in the main thread. The GUI needs some time to do the actual plotting and plt.pause
gives it that time.
I have added notes on this to the documentation.
On Windows I found I had to manually switch to that back end (on Linux I guess it was the default). An oddity I encountered in this was that I had to do any one of the following to get it to work:
matplotlib.use('Qt5Agg')
before I imported matplotlib.pyplot. If I did that after the pyplot import, then there would be no warning message, but the plot would not update (even when saving the figure - just an empty graph saved).update()
function on the ResultTablePlotplt.switch_backend('Qt5Agg')
instead of matplotlib.use
(obviously after importing pyplot as plt
).
Hi @SamSchott
How can I specify Qt5Agg as backend for Matplotlib (as required for live plotting)?
I am running one of your usage examples, which drives flawlessly my 2636B... the only problem is that plotting is not updating... and runs with the warning message below.
Thanx