pushgcf
SGfigure; SGbox; pushgcf; CPSplot(PLcircle(30)); pause(1); popgcf;
This function, pushgcf
, is part of the SG-Library and is used to remember all graphics objects in the current figure. It is particularly useful when recording all handles is not possible.
The function pushgcf
does not take any input parameters.
pushgcfhandle
: A global variable that stores the handles of all graphics objects in the current figure.pushgcftitle
: A global variable that stores the title of the current figure.findobj
function to find all graphics objects in the current figure (gcf
) and assign them to the global variable pushgcfhandle
.getgcatitle
function to retrieve the title of the current figure and assign it to the global variable pushgcftitle
.The function can be used in a sequence of commands to save the state of a figure, perform operations, and then restore the figure:
SGfigure; SGbox; pushgcf; CPSplot(PLcircle(30)); pause(1); popgcf;
In this example, a figure is created and a box is drawn. The state of the figure is saved using pushgcf
. A circle is plotted, and after a pause, the original state of the figure is restored using popgcf
.