Dear all,
I have a GUI that has two axes, Main_Axes and Side_Axes.
Now I want when mouse is over a point in the Main_Axes, it will show the same position of the mouse in the Side_Axes.
So I made a function that I called 'mouseMove', that start * the mouse position
function mouseMove (object, eventdata)C = get (gca, 'CurrentPoint');X = C(1,1);Y = C(1,2);I = getimage;hold onplot(X, Y, 'y*')hold off
Now in the callback I add this code
set(handles.Main_Axes,'HandleVisibility','ON');set(handles.Side_Axes,'HandleVisibility','OFF');imshow(I) % to show 'I' in the Main_Axes
axes(handles.Side_Axes)set (gca, 'WindowButtonMotionFcn', @mouseMove);
This makes the yellow star always appear in the Main_Axes, but it should appear in the Side_Axes.
Any idea how to fix that?
Meshoo
Best Answer