Incorrect axes limits after using tight_subplot
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear all,
I am encountering an issue querying the axis 'ylim' property when using the tight_subplot function (https://www.mathworks.com/matlabcentral/fileexchange/27991-tight_subplot-nh-nw-gap-marg_h-marg_w) from the File Exchange in MATLAB R2021a. My code is the following:
clear;clc;clf;
close all hidden;
set(gcf,'OuterPosition',[200 200 350 350]);
[ha,pos]=tight_subplot(1,1,[.10 .12],[.16 .08],[.14 .06]);
axes(ha(1));
plot([0 1 2],[0 34.8 0])
get(gca,'ylim')
The result in the command window upon executing the above code is
ans =
0 35
However, the plot produced is as follows:
When I type the last command 'get(gca,'ylim')' manually in the command window after executing the above code, I do obtain 0 and 40 as the y axis limits as expected. Could someone please explain why the original attempt to query the y axis limit in the above code segment produced the incorrect result?
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!