Info
This question is closed. Reopen it to edit or answer.
Getting mouse co-ordinates on an axis whilst zoomed
1 view (last 30 days)
Show older comments
I'm trying to get the co-ordinates of the mouse cursor over an axis whilst the mouse is down. I have this so far:
set(axis_handle, 'buttondownfcn', @axisMouseDown);
function axisMouseDown(hObject, eventdata)
current_point = get(gca, 'currentpoint');
x = current_point(1);
y = current_point(1, 2);
do_things(x, y);
end
This does get the correct co-ordinates of the cursor, but it also zooms the axis out, which is something that I'd like to avoid.
More specifically, as soon as the axisMouseDown() is fired, the axis zooms out to its default zoom level.
Thanks in advance for your help.
0 Comments
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!