copyobj from GUI to new figure but after closing figure GUI obj disappears

1 view (last 30 days)
So I have a gui that reads some data and plots it on an axis figure on the GUI itself.
The GUI also has a "export graph" button, which uses copyobj and copies the axes, and legends onto a new figure.
Everything works except when I call the command to close the figure. This command closes the figure, but at the same time, some of the objects from the original GUI disappears with it, namely the legend, and the secondary axis.
Anyone run into this issue before?
  1 Comment
Walter Roberson
Walter Roberson on 31 May 2013
Edited: Walter Roberson on 31 May 2013
Are you specifically copyobj()'ing the legend? legends reside in their own axes.
Can you test to see whether after the legend has been copied, whether the annotation objects of the original and the copy are the same object (not just same string)? If so then a delete() of the original might affect the copy.

Sign in to comment.

Answers (0)

Categories

Find more on Specifying Target for Graphics Output in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!