mpl_gui.ion#

mpl_gui.ion()[原始碼]#

啟用互動模式。

有關詳細資訊,請參閱is_interactive

另請參閱

ioff

停用互動模式。

is_interactive

是否啟用互動模式。

show

顯示所有圖形(並可能阻塞)。

注意

對於暫時性的變更,可以將此用作上下文管理器

# if interactive mode is off
# then figures will not be shown on creation
mg.ioff()
# This figure will not be shown immediately
fig = mg.figure()

with mg.ion():
    # interactive mode will be on
    # figures will automatically be shown
    fig2 = mg.figure()
    # ...

為了啟用作為上下文管理器的用法,此函數會返回一個 _IonContext 物件。返回值不應由使用者儲存或存取。