필터 지우기
필터 지우기

kid-axis-coordinates in mother-axis problem

조회 수: 1 (최근 30일)
Yu Li
Yu Li 2019년 1월 6일
댓글: Jan 2019년 1월 7일
I have a mother-axis (box 1), then I use zoom in to a kid-axis, then, I plot a box and get the coordinate using function: rect_pos = rbbox;
the 'rect_pos' is the coordinates in kic-axis, is there any way to get its coordinates in mother-axis?
I attached a figure for better understanding.
Bests,
Yu
  댓글 수: 2
Jan
Jan 2019년 1월 7일
Please reduce the number of blank lines in the text, because this impedes the reading.
Yu Li
Yu Li 2019년 1월 7일
Thanks for your suggestion, it has been revised.

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

답변 (1개)

Jan
Jan 2019년 1월 7일
What is a "mother axis" and "kid axis"? Do you mean an uipanel and an axes object? Maybe the code of https://www.mathworks.com/help/matlab/ref/getpixelposition.html helps you:
edit getpixelposition
  댓글 수: 2
Yu Li
Yu Li 2019년 1월 7일
Hi Jan:
Thanks for your reply. there are some problem with my license server so I can only explain it without figure now. below are the steps:
  1. plot a random figure:
x=rand(50,1);
y=rand(50,1);
scatter(x,y)
axis off
axis equal
set(gcf,'color','w')
the axis you see in the figure is referred as 'mother-axis'
Capture.JPG
2. in the figure panel, use the zoom in, to zoom in to any axis,, the result axis is referred as 'kid-axis'
Capture1.JPG
3. I plot a box in the kid-axis and get the coordinate using command:
k = waitforbuttonpress;
rect_pos = rbbox;
the rect-pos is the position in kid-axis.
what I want is its position in mother-axis.
hope this demonstrate my problem clearly.
Thanks!
Yu
Jan
Jan 2019년 1월 7일
Sorry, I still don't get it. After axis off I do not "see an axis in the figure". Do you mean the axes object?
"use the zoom in, to zoom in to any axis,, the result axis is referred as 'kid-axis'" - again: when I zoom in and out, I still have the same axes object and I'm not sure, what the "kid-axis" is.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by