popgcf

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 5.1, Creation date: 2021-12-05, Last change: 2025-08-18

remains only the remembered graphics object in the current figure

Description

..useful if the recording of all handles is not possible

See Also: copyfig , copygo , pastego , pushgcf

Example Illustration

 missing image of popgcf

Syntax

popgcf

Examples


SGfigure; SGbox; pushgcf; CPSplot(PLcircle(30)); pause(1); popgcf;




Copyright 2021-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, popgcf, is part of the SolidGeometry library and is used to manage graphics objects in MATLAB figures. It is particularly useful when recording all handles is not feasible.

Input Parameters

The function popgcf does not take any input parameters directly. Instead, it relies on global variables and the current figure context.

Global Variables

Algorithm Steps

  1. Retrieve all graphics object handles in the current figure using findobj(gcf).
  2. Determine which handles are not part of pushgcfhandle using setdiff.
  3. Delete the graphics objects associated with these handles using delete(delh).
  4. Set the title of the current figure to the value stored in pushgcftitle using title(pushgcftitle).

Example Usage

The function is typically used in a sequence of commands to manage figure content:

SGfigure; 
SGbox; 
pushgcf; 
CPSplot(PLcircle(30)); 
pause(1); 
popgcf;

In this example, a figure is created, a box is drawn, and the current state is saved with pushgcf. After plotting a circle and pausing, popgcf is called to restore the figure to its previous state.

Algorithm explaination created using ChatGPT on 2025-08-18 22:22. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21