how to use the "tight" function for just one axis
이전 댓글 표시
So I origionally had: axis tight But it cut both axes, whereas I just want it to be tight around the x axis but allow the y axis to not be cut. Is there a function for this please? Thanks
채택된 답변
추가 답변 (3개)
Jaromir
2018년 3월 16일
There's an out-of-the-box command for what you want:
set(handleToAxes, 'XLimSpec', 'Tight');
or
set(handleToAxes, 'YLimSpec', 'Tight');
댓글 수: 3
SOFIA DIE PANCORBO
2020년 5월 19일
I found it didn't work with "handleToAxes" but it did with "gca" instead. Thank you! :)
qilin guo
2022년 4월 26일
Undocumented properties! But useful. How many undocumented properties are there?
dpb
2022년 4월 26일
Undocumented...
ADSW121365
2022년 8월 31일
Drew Chap
2023년 5월 25일
As of R2021a, the best method to do this is:
ax = gca()
ax.XLimitMethod = 'tight'
카테고리
도움말 센터 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!