Syntax
h=SGfigurefooter(textstr)
Input Parameter
textstr : | | textstring for footer |
Output Parameter
Examples
clf; figcopyright(' by Franz Moser'); shg, SGfigurefooter('This is a test');
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, SGfigurefooter
, is designed to add a footer text to a figure window in MATLAB. It is part of the SolidGeometry library and was introduced in version 5.1.
Input Parameters
- textstr: A string that represents the text to be displayed as the footer in the figure window.
Output Results
- h: A handle to the text object created in the figure window.
Algorithm Steps
- Calculate the font size for the footer text:
- Retrieve the current axis limits using the
axis
function.
- Create a temporary text object at the lower-left corner of the axis using the input
textstr
.
- Adjust the text object to fit within the current axis using
textadjust2gca
.
- Retrieve the font size of the text object and then delete the temporary text object.
- Create a textbox annotation:
- Use the
annotation
function to create a textbox at the bottom of the figure window.
- Set the position of the textbox to span the entire width of the figure and a height of 0.05 units.
- Set the
String
property to textstr
to display the input text.
- Align the text vertically in the middle and horizontally in the center.
- Adjust the font size of the textbox:
- Retrieve the current font size of the textbox using
get
.
- Increase the font size by 2 units using
set
.
The function concludes by returning the handle h
to the created textbox annotation, allowing further customization or manipulation if needed.
Algorithm explaination created using ChatGPT on 2025-08-18 23:35. (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