【问题标题】:RE: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.plt.show() in PyCharm回复:用户警告:Matplotlib 当前正在使用 agg,它是一个非 GUI 后端,因此无法在 PyCharm 中显示 figure.plt.show()
【发布时间】:2022-12-01 05:54:17
【问题描述】:

[以前在这里问过][1]

给出的答案很好,但是它们仅以 Python/Linux 终端命令的形式解决了问题。即,须藤安装....

当我在 PyCharm 等 IDE 中时呢?我可以使用 Python 控制台进行必要的更改,但似乎有更直接的方法来简单地更改后端。

【问题讨论】:

    标签: python matplotlib pycharm


    【解决方案1】:

    我找到了examples and answers

    有什么理由我不应该只使用这里的例子吗? 例如:

    from matplotlib.backends.backend_agg import FigureCanvasAgg
    
    from matplotlib.figure import Figure
    
    import numpy as np
    
    from PIL import Image
    

    对这个问题最简单的回答是“这样做没有坏处”。

    谢谢。

    【讨论】:

      猜你喜欢
      • 2020-06-28
      • 2022-11-10
      • 2019-11-01
      • 2019-08-21
      • 2020-01-08
      • 2016-09-18
      • 1970-01-01
      • 2019-07-01
      • 2019-07-02
      相关资源
      最近更新 更多