MAtlab GUI Axis tag problem (MAtlab GUI forgets to call the tag name of axis)
4 views (last 30 days)
Show older comments
Hi all, Think of a GUI consisting of 2 axes, and pushbutton, editbox, panel and textbox. There are mathematical equations in the GUI and worked perfectly. In the first, there is one Axis in the GUI used to show plot the equations. Second Axis is added in order to put one picture and will be shown all the time when the program run. Everything works perfect!. But when i restart the matlab program and call the GUI, the tag of the second axis is lost and image cannot be shown on this axis. I have to right click on the axis, and choose CreateFunc and insert the following code.
Axis(hObject);
imshow('thenameofthepicture.jpg')
First, i did this. Second, image is not shown in the GUI. And everytime, i restart the Matlab, image cannot be shown until i right click on the GUI and check the code which is written (i added no code!) but, in the GUI tag of the axis is not written.
Everytime i have to insert tag name for the axis. How can i solve this tag problem? Why does Tag name inserted first time is deleted everytime i opened the GUI? Thanks...
0 Comments
Answers (1)
Sean de Wolski
on 7 Jun 2012
If the GUI is created in GUIDE, use the property inspector in GUIDE to give the axes a tag. After this, it should maintain its tag.
7 Comments
susana
on 30 Nov 2017
Hello, I'm having exactly the same issue. The problem is that I'm using multiple axes position to set all the objects in my GUI. As soon as I upload an image into an axes (I'm using imagesc), it erases the tag of that axes.. Since I'm using the tag property to call the object, I get errors.. Is there a solution for this? Thanks in advance
Mikael Agopov
on 14 Sep 2018
Edited: Mikael Agopov
on 14 Sep 2018
@metoo! I have axes saved in my Object with a tag.
obj.Ax2.Tag
ans = 'Ax2_main'
After showing an image with imshow, the tag is lost:
imshow(bw1,'parent',obj.Ax2);
obj.Ax2.Tag
ans = 0×0 empty char array
See Also
Categories
Find more on Interactive Control and Callbacks 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!