FUNCTION REFERENCE

gcf

Handle of the current figure.

Handle of the current figure.

Syntax

f = gcf

Returns a handle for the current figure, creating one if needed. Use it with saveas, savefig or exportgraphics, or read and change properties with dot syntax, for example f = gcf; f.Color = [1 1 1]; f.Number.

Example

saveas(gcf, 'plot.svg')   % saves the current figure

Differences from MATLAB: Takes no arguments.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.