Crusor position without click

조회 수: 8 (최근 30일)
Lin
Lin 2011년 5월 20일
Dear all, I want to get the position of crusor in an Axes without clicking on it. How can I do this ?
I read this one solution http://www.mathworks.com/support/solutions/en/data/1-1V97EZ/?solution=1-1V97EZ but currentpoint of Axes is the Location of last button click, I have to manage it wihout click.
Thank you in advance
  댓글 수: 1
Ivan van der Kroon
Ivan van der Kroon 2011년 5월 20일
This link shows you how to get the data. You do not have to click anywhere, but you have to find a way to store the data in an array. The example gives it as a title in the figure, so you can figure out yourself how to save it, right?

댓글을 달려면 로그인하십시오.

답변 (2개)

Jan
Jan 2011년 5월 20일
This gets the absolute coordinates of the pointer:
get(0, 'PointerLocation')
Getting the local coordinates relative to an AXES of FIGURE is not trivial in Matlab 2009a for docked figures. The commands OVEROBJ and HITTEST might be helpful also.

Paulo Silva
Paulo Silva 2011년 5월 20일
  댓글 수: 2
Lin
Lin 2011년 5월 20일
This is a brilliant fcn! I still have to click on the figure. Because I use axes instead of figure, I use timer fcn to call back instead of WindowButtonMotionFcn.
Thank you
Lin
Lin 2011년 5월 20일
It works in Zoom mode without click ! Why ? How can I use it in normal situation?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Exploration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by