フィルターのクリア

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 Center および File ExchangeVisual Exploration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by