繁体   English   中英

用户警告:Matplotlib 当前使用 agg,这是一个非 GUI 后端,因此无法显示图

[英]UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure

UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.

如何解决

如果要使用plt.show()则需要设置不同的后端。 Agg后端只能将绘图写入文件,不能显示交互式输出。 您可以通过在 matplotlibrc 文件 ( https://matplotlib.org/users/customizing.html#the-matplotlibrc-file ) 中设置backend字段来全局设置backend

您还可以从程序中设置后端。 只需看看上面链接的页面。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM