Navigation

Operators and Keywords

Function List:

C++ API

: h = gca ()

Return a handle to the current axis object.

The current axis is the default target for graphics output. In the case of a figure with multiple axes, gca returns the last created axes or the last axes that was clicked on with the mouse.

If no current axes object exists, create one and return its handle. The handle may then be used to examine or set properties of the axes. For example,

ax = gca ();
set (ax, "position", [0.5, 0.5, 0.5, 0.5]);

creates an empty axes object and then changes its location and size in the figure window.

Note: To find the current axis without creating a new axes object if it does not exist, query the "CurrentAxes" property of a figure.

get (gcf, "currentaxes");

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

Package: octave