You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.0.0b1.post7580.dev0+ge487118
matplotlib
Fork me on GitHub

This Page

matplotlib.pyplot.hold

matplotlib.pyplot.hold(b=None)

Deprecated since version 2.0: pyplot.hold is deprecated. Future behavior will be consistent with the long-time default: plot commands add elements without first clearing the Axes and/or Figure.

Set the hold state. If b is None (default), toggle the hold state, else set the hold state to boolean value b:

hold()      # toggle hold
hold(True)  # hold is on
hold(False) # hold is off

When hold is True, subsequent plot commands will add elements to the current axes. When hold is False, the current axes and figure will be cleared on the next plot command.