It seems that imshow just deletes all other objects or handles in the parenting axes. Say I have a script like this
fig = figure;
ax = axes(fig);
text(ax, 0.5, 0.5, 'string');
h0 = findobj(ax, 'Type', 'text');
img = randn(128, 128);
imshow(img);
h = findobj(ax, 'Type', 'text');
h0 is a 1x1 text, but h is empty!
Another wierd behaviour of imshow is that you cannot set the axes in the imshow command, i.e. imshow(ax, img) is not allowed.
Why is imshow so different?
2 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/655813-does-imshow-just-delete-all-other-objects-in-the-axes#comment_1150778
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/655813-does-imshow-just-delete-all-other-objects-in-the-axes#comment_1150778
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/655813-does-imshow-just-delete-all-other-objects-in-the-axes#comment_1150818
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/655813-does-imshow-just-delete-all-other-objects-in-the-axes#comment_1150818
Sign in to comment.