kid-axis-coordinates in mother-axis problem

1 Ansicht (letzte 30 Tage)
Yu Li
Yu Li am 6 Jan. 2019
Kommentiert: Jan am 7 Jan. 2019
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 Kommentare
Jan
Jan am 7 Jan. 2019
Please reduce the number of blank lines in the text, because this impedes the reading.
Yu Li
Yu Li am 7 Jan. 2019
Thanks for your suggestion, it has been revised.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jan
Jan am 7 Jan. 2019
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 Kommentare
Yu Li
Yu Li am 7 Jan. 2019
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 am 7 Jan. 2019
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by