On this page
matplotlib.pyplot.ion
matplotlib.pyplot.ion()[source]-
Enable interactive mode.
See
pyplot.isinteractivefor more details.See also
-
ioff - Disable interactive mode.
-
isinteractive - Whether interactive mode is enabled.
-
show - Show all figures (and maybe block).
-
pause - Show all figures, and block for a time.
Notes
For a temporary change, this can be used as a context manager:
# if interactive mode is off # then figures will not be shown on creation plt.ioff() # This figure will not be shown immediately fig = plt.figure() with plt.ion(): # interactive mode will be on # figures will automatically be shown fig2 = plt.figure() # ...To enable usage as a context manager, this function returns an
_IonContextobject. The return value is not intended to be stored or accessed by the user. -
Examples using matplotlib.pyplot.ion
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.4.3/api/_as_gen/matplotlib.pyplot.ion.html