Get drawable axis position after axis equal
13 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Jan
on 20 Nov 2017
Edited: Jan
on 20 Nov 2017
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.
More Answers (0)
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!