Effacer les filtres
Effacer les filtres

kid-axis-coordinates in mother-axis problem

1 vue (au cours des 30 derniers jours)
Yu Li
Yu Li le 6 Jan 2019
Commenté : Jan le 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 commentaires
Jan
Jan le 7 Jan 2019
Please reduce the number of blank lines in the text, because this impedes the reading.
Yu Li
Yu Li le 7 Jan 2019
Thanks for your suggestion, it has been revised.

Connectez-vous pour commenter.

Réponses (1)

Jan
Jan le 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 commentaires
Yu Li
Yu Li le 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 le 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Visual Exploration dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by