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 Properties.
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
CurrentFigure
property on the root object.MATLAB® returnsfig = get(groot,'CurrentFigure');
fig
as an empty array if there is no current figure.
Version History
Introduced before R2006a