如何在MATLAB绘图中找到轴的最小和最大值?
发布于 2010-10-19 12:48:23
以下是如何在当前轴(即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了解更多信息。
发布于 2010-10-19 14:37:31
如果您不介意使用属性的方式,请使用
检索最小值和最大值的xlim
ylim
或zlim
,或者
xlim([minValue maxValue])
设置限制。
有关其他参数,请参阅set or query axis limits。
https://stackoverflow.com/questions/3965344
复制相似问题