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!