如何在 MATLAB 绘图中找到轴的最小值和最大值?
最佳答案
以下是您如何针对当前轴(即 gca
)执行此操作:
xLimits = get(gca,'XLim'); % Get the range of the x axis
yLimits = get(gca,'YLim'); % Get the range of the y axis
zLimits = get(gca,'ZLim'); % Get the range of the z axis
上面的每个变量都是一个 1×2 数组,其中包含相应轴的最小值和最大值。你可以查看the documentation on axes properties获取更多信息。
关于matlab - 我如何在 MATLAB 中获得轴的上限(和下限)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3965344/