Navigation

Operators and Keywords

Function List:

C++ API

: h = gcf ()

Return a handle to the current figure.

The current figure is the default target for graphics output. If multiple figures exist, gcf returns the last created figure or the last figure that was clicked on with the mouse.

If a current figure does not exist, create one and return its handle. The handle may then be used to examine or set properties of the figure. For example,

fplot (@sin, [-10, 10]);
fig = gcf ();
set (fig, "numbertitle", "off", "name", "sin plot")

plots a sine wave, finds the handle of the current figure, and then renames the figure window to describe the contents.

Note: To find the current figure without creating a new one if it does not exist, query the "CurrentFigure" property of the root graphics object.

get (0, "currentfigure");

See also: gca, gco, gcbf, gcbo, get, set.

Package: octave