Disable interactive mode.
See pyplot.isinteractive for more details.
See also
ionEnable interactive mode.
isinteractiveWhether interactive mode is enabled.
showShow all figures (and maybe block).
pauseShow all figures, and block for a time.
For a temporary change, this can be used as a context manager:
# 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()
# ...
To enable optional usage as a context manager, this function returns a context manager object, which is not intended to be stored or accessed by the user.
© 2012–2023 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.ioff.html