| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
hold on
hold off
hold all
hold
hold(axes_handle,...)
The hold function determines whether new graphics objects are added to the graph or replace objects in the graph.
hold on retains the current plot and certain axes properties so that subsequent graphing commands add to the existing graph.
hold off resets axes properties to their defaults before drawing new plots. hold off is the default.
hold all holds the plot and the current line color and line style so that subsequent plotting commands do not reset the ColorOrder and ColorOrder property values to the beginning of the list. Plotting commands continue cycling through the predefined colors and linestyles from where the last plot stopped in the list.
hold toggles the hold state between adding to the graph and replacing the graph.
hold(axes_handle,...) applies the hold to the axes identified by the handle axes_handle.
Test the hold state using the ishold function.
Although the hold state is on, some axes properties change to accommodate additional graphics objects. For example, the axes' limits increase when the data requires them to do so.
The hold function sets the NextPlot property of the current figure and the current axes. If several axes objects exist in a figure window, each axes has its own hold state. hold also creates an axes if one does not exist.
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.
hold toggles the NextPlot property between the add and replace states.
The NextPlot property of axes and figure graphics objects
Basic Plots and Graphs for related functions
![]() | histc | home | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2010- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |