hold on retains plots in the current axes
so that new plots added to the axes do not delete existing plots.
New plots use the next colors and line styles based on the ColorOrder and LineStyleOrder properties
of the axes. MATLAB^{®} adjusts axes limits, tick marks, and tick
labels to display the full range of data.

hold off sets the hold state to off so
that new plots added to the axes clear existing plots and reset all
axes properties. The next plot added to the axes uses the first color
and line style based on the ColorOrder and LineStyleOrder properties
of the axes. This is the default behavior.

hold all is the same as hold on.
This syntax will be removed in a future release. Use hold
on instead.

hold(ax,'on') retains
plots in the axes specified by ax so that new plots
added to the axes do not delete existing plots. New plots use the
next colors and line styles based on the ColorOrder and LineStyleOrder properties
of the axes. MATLAB adjusts axes limits, tick marks, and tick
labels to display the full range of data. You can specify a different
hold state for each axes.

hold(ax,'off') sets
the hold state to off so that new plots added to the axes clear existing
plots and reset all axes properties. The next plot added to the axes
uses the first color and line style based on the ColorOrder and LineStyleOrder properties
of the axes.

hold(ax) toggles the hold state between
on and off.

Create a line plot. Then, use hold on to add a second line plot without deleting the existing plot. The new plot uses the next color and line style based on the ColorOrder and LineStyleOrder properties of the axes.

x = linspace(-pi,pi);
y1 = sin(x);
y2 = cos(x);
plot(x,y1)
hold on
plot(x,y2)

Reset the hold state to off so that new plots delete existing plots. New plots start from the beginning of the color order and line style order.