- Determine the position and size of the left panel: You can get this information from the Position property of the panel.
- Set up the 'WindowButtonMotionFcn' callback for the figure: This callback will be executed whenever the mouse moves within the figure window.
- In the callback function, check the cursor's position. Use the 'CurrentPoint' property of the figure to get the cursor's position.
- Compare the cursor's position to the left panel's boundaries. If the cursor is within the left panel, disable the rotation interaction on the plot; otherwise, enable it.
Point cloud rotate beyond plot limit (App Design based)
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello!
My app has two panels: on the left data input, on the right plot results. My problem is: the plot can be rotated even when the mouse cursor appears on the left panel. How can i prevent this? The user could accidentally rotate the plot when changing input data.
The plot parent is a grid, children of the right panel.
Thank you
댓글 수: 0
답변 (1개)
Raghav Bansal
2023년 12월 28일
Hi Veronica,
To prevent the plot from rotating when the mouse is over the left panel, you can use the 'WindowButtonMotionFcn' callback of the figure to detect the cursor's position and disable the rotation if the cursor is over the left panel. You'll need to determine the boundaries of the left panel in the figure's coordinate system and then check if the cursor's position is within those boundaries.
Here's a step-by-step approach you can follow:
Hope it helps!
Regards,
Raghav
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!