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)
| 765 | |
| 766 | |
| 767 | def 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) |
nothing calls this directly
no test coverage detected
searching dependent graphs…