Get drawable axis position after axis equal
13 次查看(过去 30 天)
显示 更早的评论
Say I run this simple test:
figure;
axis;
axis equal;
Then you resize it a little, and run this
disp(gca.Position)
The answer will always be
ans =
0.1300 0.1100 0.7750 0.8150
which means the Position array will always stay the same, but the drawable (white) area of the axes object will always be resized to fit as much as possible inside that Position array.
The thing is that I want the actual position of the upper-right corner of the drawable area axes object. In this image, I want the position of the green point, not the red point to which I could arrive simply using Position.

0 个评论
采纳的回答
Jan
2017-11-20
编辑:Jan
2017-11-20
See https://www.mathworks.com/matlabcentral/answers/5882-getting-the-axis-position-correctly : The properties TightInset and PlotBoxAspectRatio matter. Before you can interpret them, the axes' units must be set to pixels:
figure
h = axes
axis equal
pause(5); % Change the figure size
h.Units = 'pixels';
disp(h.TightInset)
disp(h.PlotBoxAspectRatio)
disp(h.Position)
h.Units = normalized;
This should help you to find the solution. Unfortunately I cannot provide a working code yet.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!