MATLAB: How to remove the black outlines when using ‘image’ command to display a image.

imageremove outlines

Hi everyone,
I wanna display an image but also want to drag and drop this image. As far as I know, if I use command 'imshow' to display the image it is not draggable. I therefore have to use command 'Image' to display a single pixel image.
To simplify my question, I use the minimum code to this problem. See below.
Figure;
axes; % to draw an axes
I = ones(1,1,3); I(:,:,1) = 255; I(:,:,2) = 255;I(:,:,3) = 0; % to create a single pixel image file (yellow of course).
image(I) % display the single pixel yellow image in the axes.

Best Answer

I = ones(1,1,3);
I(:,:,1) = 255; I(:,:,2) = 255;I(:,:,3) = 0;
AxesH = axes('Visible', 'off', 'NextPlot', 'add');
image(I, 'Parent', AxesH);
Setting the Visiblility to 'off', hides the ticks and the box.