VMgetSubplot

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 3.6, Creation date: 2017-03-21, Last change: 2025-08-18

returns the current active subplot

Description

This function returns for the VMplot figure, the number of the subplot, of the last VMginput position was taken

See Also: VMginput , VMplot

Example Illustration

 missing image of VMgetSubplot

Syntax

subpn=VMgetSubplot

Output Parameter

subpn: current subplot position; empty if figure is not valid




Copyright 2017-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, VMgetSubplot, is designed to return the current active subplot number from a VMplot figure, specifically the subplot where the last VMginput position was taken.

Input Parameters

The function does not take any input parameters.

Global Variables

Output

Algorithm Steps

  1. The function begins by checking if the global variable VMplothandle is a valid figure handle using the isvalid function.
  2. If VMplothandle is valid, the function retrieves the title of the current axes using get(gca, 'Title') and then gets the string of the title with get(t, 'String').
  3. The function then checks the content of the title string to determine the subplot number:
    • If the title contains 'y/z', it sets subpn to 1.
    • If the title contains 'x/z', it sets subpn to 2.
    • If the title contains 'x/y', it sets subpn to 4.
    • If none of these conditions are met, it sets subpn to 0.
  4. If VMplothandle is not valid, the function sets subpn to an empty array.
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