kid-axis-coordinates in mother-axis problem

1 次查看(过去 30 天)
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