MATLAB: Imshow and GUI axis handles

axesaxisgraphhandle graphicshandlesimageImage Processing Toolboxplot

I have to display an image in a GUI figure. In the figure there are two axes.
How can I tell
imshow
to display the image in the axis I want? With
plot
I could use
plot(handles.axis1,image)
but this doesn't work for imshow (<http://www.mathworks.it/it/help/images/ref/imshow.html>)! The code
imshow(handles.axis1,image)
is not allowed,
imshow
doesn't accept axis handles.
Any suggestion to solve this issue?

Best Answer

You can specify the axes in the call to imshow with the 'Parent' option:
imshow(yourImage, 'Parent', handles.axesImage);
or you can specify it with the axes function in advance of calling imshow():
axes(handles.axesImage);
imshow(yourImage);