Documentation

clf

Clear current figure window

Syntax

clf
clf('reset')
clf(fig)
clf(fig,'reset')
无花果ure_handle = clf(...)

Description

clfdeletes from the current figure all graphics objects whose handles are not hidden (i.e., theirHandleVisibilityproperty is set toon).

clf('reset')deletes from the current figure all graphics objects regardless of the setting of theirHandleVisibilityproperty and resets all figure properties exceptPosition,Units,PaperPosition, andPaperUnitsto their default values.

clf(fig)orclf(fig,'reset')clears the single figure with handle无花果.

无花果ure_handle = clf(...)returns the handle of the figure. This is useful when the figureIntegerHandleproperty isoffbecause the noninteger handle becomes invalid when the reset option is used (i.e.,IntegerHandleis reset toon, which is the default).

Alternatives

UseClear Figurefrom the figure window'sEditmenu to clear the contents of a figure. You can also create adesktop shortcutto clear the current figure with one mouse click. SeeRerun Favorite Commands.

Tips

Theclfcommand behaves the same way when issued on the command line as it does in callback routines — it does not recognize theHandleVisibilitysetting ofcallback. This means that when issued from within a callback routine,clfdeletes only those objects whoseHandleVisibilityproperty is set toon.

See Also

|||

Introduced before R2006a

Was this topic helpful?