axesofgcf

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 4.3, Creation date: 2018-10-24, Last change: 2025-09-14

returns the handles to the axis

Description

h=getfuncparams(1,varargin,gcf);
h=get(h,'Children'); b=strcmp(get(h,'Type'),'axes');h=h(b);

Example Illustration

 missing image of axesofgcf(h)

Syntax

h=axesofgcf([h])

Input Parameter

h: handlo to graphics objects; default is gcf

Output Parameter

h: handles as array (sorted descending)

Examples


PLsample; axesofgcf, delete(ans(5))




Copyright 2018-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 algorithm is a MATLAB function named axesofgcf that retrieves the handles to the axes objects within the current figure or a specified graphics object.

Input Parameters

Output

Algorithm Steps

  1. The function begins by calling getfuncparams with the arguments 1, varargin, and gcf. This function is assumed to process the input arguments and return a handle, defaulting to the current figure if no specific handle is provided.
  2. It retrieves the children of the specified graphics object using get(h, 'Children'). This returns all child objects of the handle h.
  3. The function then uses strcmp to compare the 'Type' property of each child object to the string 'axes'. This creates a logical array b where each element is true if the corresponding child is an axes object.
  4. Finally, the function filters the children handles using the logical array b to return only the handles that correspond to axes objects.

Example Usage

The example PLsample; axesofgcf, delete(ans(5)) demonstrates how to use the function. It first runs PLsample, then calls axesofgcf to get the axes handles, and finally deletes the fifth axes object in the list of handles returned.

Algorithm explaination created using ChatGPT on 2025-08-18 22:21. (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