【发布时间】:2022-08-04 23:15:14
【问题描述】:
我添加了
matplotlib.use(\'Agg\')
到我的一个 Python 脚本,以便尝试使用集群进行绘图。 现在我无法绘制任何东西,即使在我自己的 MacBook 上尝试。错误消息指出:
UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
我也可以在 Matplotlib 中\'unuse\' agg 吗?
-
Agg 不会让你渲染到 gui。如果你想“使用”另一个后端。如果您在集群上,或者以其他方式使用 agg,则需要使用 fig.savefig 保存文件。
标签: matplotlib