Adding and deleting annotations to a panel

Hi, I have created a GUI and I am displaying a figure in a panel. This figure has annotations but they do not display when the figure axis is displayed on the panel. To show the annotations, I have tried using:
ann1 = findall(fighandle,'tag', 'scribeOverlay');
copyobj(ann1,Parent);
where fighandle is the handle of the figure and Parent is the handle of the panel on which the figure is displayed. This works to display the annotations, and I can then delete the annotations using:
delete(findall(Parent,'tag', 'scribeOverlay'))
But when I try to add another annotation using the same method, I get the following error:
Error using matlab.graphics.shape.internal.ScribeStackManager/loadLayer Layer already exists
Error in matlab.graphics.shape.internal.AnnotationPane/setParentImpl
Any help would be great! Thanks.

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 24 Oct 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!