I have been able to add rectangles with drawrectangle with the mouse click callback, like this:
My main code for plotting:
linkaxes([ti1 ti3 ti5],'xy')
set([im1 im2 im3],'ButtonDownFcn',@ImageClickCallback);
My callback function:
function ImageClickCallback (objectHandle , eventData )
axesHandle = get(objectHandle,'Parent')
coordinates = get(axesHandle,'CurrentPoint');
coordinates = coordinates(1,1:2)
With this I'm able to draw the rectangle in the image where the click was perfromed, and I would like to draw the rectangle in the 3 images simultaneously , so no matter what image you click, you will add in that same location a rectangle in the 3 images. Is that possible?
The 3 images have the same width and length.