gcf
Current figure handle
Syntax
Description
returns the current
figure handle. If a figure does not exist, then fig = gcfgcf
creates a figure and returns its handle. You can use the figure handle to query and
modify figure properties. For more information, see Figure.
Examples
More About
Tips
To get the handle of the current figure without forcing the creation of a figure if one does not exist, query the
CurrentFigureproperty on the root object.MATLAB® returnsfig = get(groot,'CurrentFigure');figas an empty array if there is no current figure.
Version History
Introduced before R2006a
