【问题标题】:plt.close('all') Python not working in Spyderplt.close('all') Python 在 Spyder 中不起作用
【发布时间】:2020-09-13 09:41:48
【问题描述】:

我一直在尝试使用 Python 在 Spyder 中的代码开头关闭所有图表,但是我没有想出解决方案。 我已经搜索了几种方法来做到这一点,但是没有一个有效,包括 matplotlib 指定的编码。 https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.close.html

import matplotlib.pyplot as plt
plt.show(block=False)
plt.pause(3)
plt.close('all')

我想知道这是否是一个 Spyder 错误。

有人知道我可以尝试做什么吗?

【问题讨论】:

    标签: python matplotlib graph spyder


    【解决方案1】:

    我尝试了这里提到的解决方案:https://github.com/spyder-ide/spyder/issues/5350 我尝试了你描述的那个,但它也对我不起作用。

    我想在执行代码之前最好使用快捷键“ctrl+shift+w”。

    【讨论】:

      猜你喜欢
      • 2019-04-27
      • 2017-06-08
      • 2015-09-12
      • 2019-06-11
      • 1970-01-01
      • 2018-09-05
      • 2018-01-22
      • 2021-07-01
      • 2021-12-17
      相关资源
      最近更新 更多