필터 지우기
필터 지우기

How can I get points coordinate on an axes made in GUI?

조회 수: 1 (최근 30일)
Julien Houle
Julien Houle 2015년 7월 20일
답변: J. Alex Lee 2020년 8월 30일
Hi, I'm using a GUI which uses, a certain function_A to build an axes. Every time I call the function_A, I give the axis handle and use it with "figure = newplot(handle)". Then it displays the wanted axis (still in the same function_A). When finish, it gives back the figure. Until then, it works, the axis show what I want. But when I try to get to the coordinate of my mouse on axis "point = get(handles.axis1,'CurrentPoint')" it does not work. Even the function axis_ButtonDownFcn does not work while it was working BEFORE the figure was send to axis1. As if it can not access to the "axes background" as described in the comments of the axis_ButtonDownFcn. Can anyone help with this?
  댓글 수: 2
Hasaan Ijaz
Hasaan Ijaz 2020년 8월 29일
Can someone please answer this? I'm also stuck
Rik
Rik 2020년 8월 29일
@Hasaan, you're probably better off posting your own question and provide more details. Attach the function you're using and provide instructions on how to replicate the issue. Try to reduce the size of your function as much as you can: remove every line that doesn't contribute to causing the problem.

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

답변 (1개)

J. Alex Lee
J. Alex Lee 2020년 8월 30일
It sounds like the click is being "intercepted" by the object that you drew on the axes (please don't use the word "figure", because it is simpler to keep the nomenclature within the matlab programming language).
If this is the case, you can set the "HitTest" property of all the objects you draw on the axes to "off" and prevent this behavior.

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by