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

àì夳堔傛蜴生んèń 2022-11-29 05:52 207阅读 0赞

报错类型:Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.

解决方案:

加入以下语句:

  1. import matplotlib as mpl
  2. import matplotlib.pyplot as plt
  3. mpl.use(‘TkAgg’)

但是我加入以后还是无法显示图片,原因在于mpl.use(‘TkAgg’)语句要在导入所有包之后即最后加。

发表评论

表情:
评论列表 (有 0 条评论,207人围观)

还没有评论,来说两句吧...

相关阅读