Why does image function always delete tag of axes control ?
Show older comments
How do I prevent this ?
4 Comments
Image Analyst
on 8 Nov 2018
It doesn't. Upload your program and tell us what ot do to prove to us that it does that with your program.
Also when you're editing your post, please add what version of MATLAB you're using, and what operating system. If you're using Windows, you can type psr after you type the windows key, then run the Steps Records and show us a screenshot-by-screenshot recording of what you're doing so we can see exactly what you're seeing.
Gerald
on 8 Nov 2018
Image Analyst
on 8 Nov 2018
axes1 is the tag. You should never add an additional field onto the tag field. It might not even be allowed, as you can see when you try to display it.
And generally, none of the fields that you see in the Property Inspector of guide should have a field created/added to them. For example, you would not add a field called "whatever" to the units field
handles.axes1.units.whatever = 'abcd'; % DO NOT do this.
Guillaume
on 8 Nov 2018
I see nothing wrong in the code shown by Gerald, he does not add a field to Tag and even if he did, it's fine to assign a structure to Tag.
As per the answer I linked to in my answer below, the high-level version of image and imagesc will reset almost all axes properties by default, including the Tag property. Follow the link for various ways to solve the issue.
Accepted Answer
More Answers (0)
Categories
Find more on Images 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!