selectsubplot

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 5.0, Creation date: 2021-01-05, Last change: 2025-08-18

interactively select a subplot

Description

extracted from SGTregisterframes

See Also: select3D , subplotnumber

Example Illustration

 missing image of selectsubplot

Syntax

[hi,cfsp]=selectsubplot

Output Parameter

hi: selected subplot by last click cursor position
cfsp: list of all subplots

Examples


PLsample; ginput(1);
selectsubplot




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, selectsubplot, is designed to interactively select a subplot within a MATLAB figure. It is part of the SolidGeometry library and was introduced in version 5.0. The function is primarily used for user interface purposes, allowing users to identify and work with specific subplots within a graphical figure.

Input Parameters

The function selectsubplot does not take any input parameters. It operates on the current figure and axes available in the MATLAB environment.

Output Results

Algorithm Steps

  1. The function begins by identifying all objects of type 'Axes' within the current figure using the findobj function. This is stored in the variable cfsp.
  2. It then determines which of these axes is the current axes (the one most recently interacted with) using ismember in conjunction with gca (get current axes). The result is stored in hi.
  3. The function also identifies all axes that are not the current axes by using the logical negation of the previous step. These are stored in hk.

Example Usage

An example of how to use this function is provided in the comments:

PLsample; ginput(1);
selectsubplot

In this example, PLsample presumably sets up a figure with subplots, and ginput(1) waits for a mouse click to select a subplot. The selectsubplot function is then called to identify the selected subplot.

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