Skip to content

hold

Control whether new plots replace or add to existing graphs.

hold on
hold off
hold('on')

hold on makes subsequent plot calls add to the current axes (preserving existing graphs). hold off (default) makes the next plot call clear the axes first. Common for overlaying multiple data series.

plot(x, y1); hold on;
plot(x, y2);
hold off
  • clf — Clear the current figure.
  • axes — Create or activate axes within a figure.
  • figure — Create or activate a chart sheet (figure window).