getting the axis position correctly
Ältere Kommentare anzeigen
I can get the position of the axis easily
figure,plot([0 1], [0 1])
axis equal
AxesHandle=findobj(gcf,'Type','axes');
get(AxesHandle,'Position')
However when I modify the axis limits the axis position does not update.
axis tight
get(AxesHandle,'Position')
still gives me the same answer. How do I get the correct axis position in the second case?
Akzeptierte Antwort
Weitere Antworten (2)
Kelly Kearney
am 20 Apr. 2011
8 Stimmen
I wrote a little function that analyzes the aspect ratios and calculates the plotted axis region:
Should return exactly what you're looking for.
2 Kommentare
dk
am 20 Apr. 2011
Yujendra Mitikiri
am 23 Okt. 2021
Bearbeitet: Yujendra Mitikiri
am 23 Okt. 2021
Thank you! This is exactly what I needed, in order to add annotations after making "axis equal."
Paulo Silva
am 20 Apr. 2011
The position remains the same, don't believe me? go to Tools and press Edit Plot, now click on the axis :)
One thing that do change is the:
xlim
1 Kommentar
dk
am 20 Apr. 2011
Kategorien
Mehr zu Axis Labels finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!