MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / pause

Function pause

lib/matplotlib/pyplot.py:767–792  ·  view source on GitHub ↗

Run the GUI event loop for *interval* seconds. If there is an active figure, it will be updated and displayed before the pause, and the GUI event loop (if any) will run during the pause. This can be used for crude animation. For more complex animation use :mod:`matplotlib.ani

(interval: float)

Source from the content-addressed store, hash-verified

765
766
767def pause(interval: float) -> None:
768 """
769 Run the GUI event loop for *interval* seconds.
770
771 If there is an active figure, it will be updated and displayed before the
772 pause, and the GUI event loop (if any) will run during the pause.
773
774 This can be used for crude animation. For more complex animation use
775 :mod:`matplotlib.animation`.
776
777 If there is no active figure, sleep for *interval* seconds instead.
778
779 See Also
780 --------
781 matplotlib.animation : Proper animations
782 show : Show all figures and optional block until all figures are closed.
783 """
784 manager = _pylab_helpers.Gcf.get_active()
785 if manager is not None:
786 canvas = manager.canvas
787 if canvas.figure.stale:
788 canvas.draw_idle()
789 show(block=False)
790 canvas.start_event_loop(interval)
791 else:
792 time.sleep(interval)
793
794
795@_copy_docstring_and_deprecators(matplotlib.rc)

Callers

nothing calls this directly

Calls 4

showFunction · 0.85
get_activeMethod · 0.45
draw_idleMethod · 0.45
start_event_loopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…