matlab guide - How get Current point -
good morning, have aplicattion with:
set(gcf,'windowbuttonmotionfcn',{@mousecapturelc});
where x , y coordinates mousecapturelc function.
function mousecapturelc(src, eventdata) pos = get(gca, 'currentpoint'); % axes image - (axes1) x = pos(1, 1); y = pos(1, 2); % working
this values send labels text in gui:
hfig1 = findobj('tag','lbl_x'); handles = guidata(hfig1); hfig2 = findobj('tag','lbl_y'); handles = guidata(hfig2); set(handles.lbl_x, 'string', sprintf('x: %1.0f ', x)); set(handles.lbl_y, 'string', sprintf('y: %1.0f ', y));
i need do:
i need use x values in other axes, ie (axes2), in real time. want plot columns image in axes2 moving mouse.
the problem: in side mousecapturelc(), when handle of axes2 motion function leave working.
h = gcf; axes2 = findobj(h,'tag','axes2'); axes(axes2)
it works clicking. not working more movement mouse.
1) tried values label text (in side gui function), not work of dynamic way. work click.
someone can me? thanks
worked using handle of axes2 within plot function
plot(handles.axes2,x, y)
Comments
Post a Comment