hold

Purpose

Hold the current graph.

Synopsis

hold on
hold off
hold

Description

hold on holds the current plot and all axes properties so that subsequent graphing commands add to the existing graph.

hold off returns to the default mode whereby plot commands erase previous plots and reset all axes properties before drawing new plots.

hold, by itself, toggles the hold state.

hold is a property of axes. If several axes exist in a figure window, each has its own hold state.

Algorithm

hold manipulates the NextPlot property of figure and axes objects.

hold on sets the NextPlot property of the current figure and axes to add.

hold off sets the NextPlot property of the current axes to replace.

See Also

axis, cla
The NextPlot property of axes objects.

(c) Copyright 1994 by The MathWorks, Inc.