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 个)

类别

Help CenterFile Exchange 中查找有关 Model, Block, and Port Callbacks 的更多信息

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by