matplotlib.pyplot.ioff#

matplotlib.pyplot.ioff()[源代码][源代码]#

禁用交互模式。

更多详情请参见 pyplot.isinteractive

参见

离子

启用交互模式。

isinteractive

是否启用交互模式。

显示

显示所有图片(以及可能的块)。

暂停

显示所有图片,并阻塞一段时间。

注释

对于临时更改,这可以作为上下文管理器使用:

# if interactive mode is on
# then figures will be shown on creation
plt.ion()
# This figure will be shown immediately
fig = plt.figure()

with plt.ioff():
    # interactive mode will be off
    # figures will not automatically be shown
    fig2 = plt.figure()
    # ...

为了启用作为上下文管理器的可选使用,此函数返回一个上下文管理器对象,该对象不打算由用户存储或访问。