clf
Clear current figure window
Syntax
clf
clf('reset')
clf(fig)
clf(fig,'reset')
无花果ure_handle = clf(...)
Description
clf
deletes from the current figure all graphics objects whose handles are not hidden (i.e., theirHandleVisibility
property is set toon
).
clf('reset')
deletes from the current figure all graphics objects regardless of the setting of theirHandleVisibility
property and resets all figure properties exceptPosition
,Units
,PaperPosition
, andPaperUnits
to 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 figureIntegerHandle
property isoff
because the noninteger handle becomes invalid when the reset option is used (i.e.,IntegerHandle
is 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
Theclf
command behaves the same way when issued on the command line as it does in callback routines — it does not recognize theHandleVisibility
setting ofcallback
. This means that when issued from within a callback routine,clf
deletes only those objects whoseHandleVisibility
property is set toon
.