Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8343785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:10:13+00:00 2026-06-09T06:10:13+00:00

I have a gui that includes a plot. In this plot I add an

  • 0

I have a gui that includes a plot. In this plot I add an annotation. When the plot data is changed using the gui, he old annotation remains and the new one is plotted over the old on.

So I need to remove he old annotation.
I tried the following code, but that has no effect:

set(0,'showhiddenhandles','on')
% look for all axes in the figure of choice:
h_all_axes = findall(gcf,'type','axes');
% get the 'annotation layer' axes handle:
h_anno_axes = double(find(handle(h_all_axes),'-class','graph2d.annotationlayer'));
delete(h_anno_axes);
set(0,'showhiddenhandles','off');

annotationPos = [0.55 0.58 0.6 0.3];
htxtbox = annotation('textbox',annotationPos, ...
    'String'     ,strtextbox, ...
    'FontSize'   ,FontSize+1, ...
    'FitBoxToText', 'on', ...
    'EdgeColor', 'none', ...
    'FontName'   , 'Courier New');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:10:15+00:00Added an answer on June 9, 2026 at 6:10 am

    The easiest solution is to add a specific tag to the annotation.

    %# create the annotation
    annotationPos = [0.55 0.58 0.6 0.3];
    htxtbox = annotation('textbox',annotationPos, ...
        'String'     ,strtextbox, ...
        'FontSize'   ,FontSize+1, ...
        'FitBoxToText', 'on', ...
        'EdgeColor', 'none', ...
        'FontName'   , 'Courier New', ...
        'Tag' , 'somethingUnique');
    
    %# delete the annotation
    delete(findall(gcf,'Tag','somethingUnique'))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GUI tool that manages state sequences. One component is a class
I have written a nifty thing in Java with a GUI that includes a
I have a windows service that exposes a TCP connection (using WCF). This service
I have a GUI that is going to do a lot of disparate tasks.
I have a GUI that is issuing commands to a web server based on
I have a GUI app that is getting to be quite slow. I want
I have created a GUI that will setup the pivot table. For example, I
I have a wxPython GUI application that contains 13 pairs of StaticText controls that
Suppose I have a GUI-only application that runs on Windows and I'd like to
I am going to make a GUI that will have dynamically created sets of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.