plotannotationdelete

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

delete plot annotation

Description

Since the textboxes are children of groot is is difficult to delete them

See Also: SGfigureannotation , SGhelptext , plotannotation , plotannotationtopleft , titleofcaller , plotannotatecolors , plotannotationtext

Example Illustration

 missing image of plotannotationdelete

Syntax

h=plotannotationdelete

Output Parameter

h: handle to deleted textboxes

Examples


plotannotationtopleft ('A'), plotannotation('B'); shg; pause, plotannotationdelete;




Copyright 2020-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, plotannotationdelete, is designed to delete textboxes from a MATLAB plot. It is part of the SolidGeometry library and was introduced in version 5.0. The function operates by identifying and removing textboxes that are children of the root graphics object, groot.

Input Parameters

The function does not take any input parameters.

Output

Algorithm Steps

  1. Use the findall function with groot to locate all graphics objects in the current MATLAB session.
  2. Filter these objects to find those of type 'Textbox' using the findobj function.
  3. Store the handles of these textboxes in the variable h.
  4. Delete the textboxes using the delete function, passing h as the argument.

Example Usage

The function can be used in a sequence of plotting commands to remove annotations after they have been displayed:

plotannotationtopleft('A');
plotannotation('B');
shg;
pause;
plotannotationdelete;

This example demonstrates creating annotations 'A' and 'B', displaying the plot, pausing for user interaction, and then deleting the annotations.

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