【发布时间】:2015-01-19 22:53:05
【问题描述】:
当我在 Enthought Canopy 编辑器的 Python shell 中执行 pyplot.figure() 时,会显示一个图形菜单。但是当我运行以下脚本时,没有显示图形菜单?
from matplotlib import pyplot
def ex1():
pyplot.figure()
if __name__ == "__main__":
ex1()
编辑:我在重新执行脚本“几次”后收到以下消息。但我没有看到一个数字。
C:\Users\Matthias\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\pyplot.py:412: RuntimeWarning: 已打开超过 20 个图形。通过 pyplot 接口 (matplotlib.pyplot.figure) 创建的图形会一直保留到显式关闭,并且可能会消耗太多内存。 (要控制此警告,请参阅 rcParam figure.max_num_figures)。
max_open_warning, RuntimeWarning)
Edit2:这似乎工作正常。
import pylab
def ex1():
pylab.figure()
pylab.show()
if __name__ == "__main__":
ex1()
【问题讨论】:
标签: python matplotlib enthought canopy