SGfigureannotation

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 4.2, Creation date: 2018-03-12, Last change: 2025-09-14

creates a simple help text annotation into the current figure

Description

Used in functions such as SGTui

See Also: plotannotation , SGfigure , SGtitle , titleofcaller , SGhelptext

Example Illustration

 missing image of SGfigureannotation(str,bc,sz,sl,hl)

Syntax

h=SGfigureannotation(str,[bc,sz,sl,hl])

Input Parameter

str: string
bc: backgoundcolor; default is unchanged
sz: text size; default is 10
sl: starting position from bottom; default is 0.97%
hl: height of annotation; default is 1-sl

Output Parameter

h: handle to annotation

Examples


SGfigure;
SGfigureannotation('This is a simple help text','y',16,0.9)




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 function, SGfigureannotation, creates a simple help text annotation in the current figure. It is part of the SolidGeometry library and is used in functions like SGTui.

Input Parameters

Output

Algorithm Steps

  1. Initialize default values for the parameters bc, sz, sl, and hl.
  2. Check if each parameter is provided in varargin and update the default values accordingly.
  3. Calculate the horizontal position bl using the function getfuncparams with a default value of 1.
  4. Adjust bl to center the annotation horizontally.
  5. Create the annotation using the annotation function with the specified parameters.
  6. If a background color bc is provided, set it for the annotation.

Example Usage

To create an annotation with specific parameters:

SGfigure;
SGfigureannotation('This is a simple help text', 'y', 16, 0.9);
Algorithm explaination created using ChatGPT on 2025-08-19 07:49. (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