Clear image from axes in matlab GUI
Show older comments
I have a button named 'clear' and within it, i tried the following for clearing image from current axes:
delete(get(handles.axes1,'Children'))
cla(handles.axes1,'reset')
cla(handles.axes1)
Trying all these separately, my image doesn't get cleared from the axes in actual i.e. (axes doesn't get white again). But yes that axes is selected again.
How can this clearance be done?
Thanks
Answers (2)
Image Analyst
on 19 Dec 2013
Maybe try this:
axes(handles.axes1);
hold off;
cla reset;
What you're saying sounds strange. I've never had a case where I can see an image being displayed in an axes and that does not vanish and get replaced by white when I do a cla('reset'). Are you sure you've referenced the correct axes? What name shows up on it in GUIDE? Does it say axes1? Or something else?
2 Comments
timothy lienanto
on 18 Nov 2020
how do i reset the table information to like x and y number
Image Analyst
on 18 Nov 2020
What table? Do you mean tick marks and tick labels outside the image?
Walter Roberson
on 19 Dec 2013
Before you do that, try
findobj(handles.axes1, 'type', 'image')
and see if the image shows up. Then try
imgs = findall(0, 'type', 'image');
imgs_parent = get(imgs, 'Parent');
imgs_elsewhere = imgs_parent(handles.axes1 ~= imgs_parent);
if isempty(imgs_elsewhere)
disp('No other images')
else
disp('Images also found in axes:');
imgs_elsewhere
end
1 Comment
Raisa Qadir
on 19 Dec 2013
Categories
Find more on Image Arithmetic 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!