Main Content

ishold

Current hold state

Syntax

tf = ishold
tf = ishold(ax)

Description

tf = ishold returns the hold state of the current axes. The return state is 1 if hold is on, and 0 if it is off. When hold is on, the current plot and most axes properties are held so that subsequent graphing commands add to the existing graph. If there is no figure, ishold returns 0 and MATLAB® creates a new figure.

tf = ishold(ax) returns the hold state of the specified axes object, which can be an Axes, PolarAxes, or GeographicAxes object. You can also specify ax as an array of multiple axes objects that belong to the same class (use the class function to determine the class).

A state of hold on implies that both figure and axes NextPlot properties are set to 'add'.

Version History

Introduced before R2006a