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
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
- str: A string that represents the text to be displayed in the annotation.
- bc: Background color of the annotation. If not specified, the default is unchanged.
- sz: Text size. The default value is 10.
- sl: Starting position from the bottom of the figure. The default value is 0.97 (97%).
- hl: Height of the annotation. The default value is calculated as
1 - sl
.
Output
- h: Handle to the annotation object created.
Algorithm Steps
- Initialize default values for the parameters
bc
, sz
, sl
, and hl
.
- Check if each parameter is provided in
varargin
and update the default values accordingly.
- Calculate the horizontal position
bl
using the function getfuncparams
with a default value of 1.
- Adjust
bl
to center the annotation horizontally.
- Create the annotation using the
annotation
function with the specified parameters.
- 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