Why does GUIDE delete tags to axes handles?

4 views (last 30 days)
Isaac
Isaac on 8 Sep 2015
Answered: Matt Cohen on 10 Sep 2015
I tried to edit a figure in GUIDE and received the following error message when I opened the figure to edit it: "This FIG file contains one or more legend or colorbar objects, which GUIDE does not support. GUIDE removes these unsupported objects when loading the figure. If you save the GUI the FIG file no longer contains the unsupported objects."
After pushing OK the figure opened, but I noticed that all of the tags for the "Axes" handles had been deleted -- the axes still appeared in GUIDE, but were no longer referenced by any tag. E.g. for what used to be called 'axes1', the tag name disappeared. If I subsequently run the associated script, I receive the error: "Reference to the non-existent field 'axes1'"
Any idea why this is? And what can I do to fix it?
I would note that I've been using the figure without any problems for a few months, it is only when I tried to edit the figure that I started seeing these errors.

Answers (1)

Matt Cohen
Matt Cohen on 10 Sep 2015
Hi Isaac,
I understand that you are encountering an issue where the value of the TAG property is deleted from axes handles by GUIDE.
At some point, did you use the SAVE button on the GUIDE toolbar to save your figure? By default, this will save the current figure as a FIG file with the same name as the original FIG generated by GUIDE. This overwrites the GUIDE FIG with the new one. The save action also clears the TAG property of the axes. One workaround for this issue is to delete the axes from GUIDE and create a new one.
Also, make sure you are not clearing the current axes or resetting the axes properties in any scripts or callback functions associated with your figure, such as with the "cla" function.
If this continues and you are unable to resolve it, you may want to contact MathWorks Technical Support about the issue.
I hope this helps.
Matt Cohen

Categories

Find more on Migrate GUIDE Apps 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!