最近要在多线程中调用matplotlib绘图,在运行时报出“py:227: UserWarning: Starting a Matplotlib GUI outside of the main thread will likely fail.fig = plt.figure(figsize=(8,5))”的错误。在网上查了许久,发现多线程中matplotlib的问题很多人都遇到了,大家提出的解决办法可参考以下两个连接:
(Python)在子线程中使用Matplotlib进行绘图(100%解决问题)_userwarning: starting a matplotlib gui outside of -CSDN博客