### Navigation

- index
- modules |
- next |
- previous |
- home|
- examples|
- tutorials|
- pyplot|
- docs »
- The Matplotlib API »
- matplotlib.pyplot »

# 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.