How do I find the minimum and maximum of the axis in a MATLAB plot?
Here's how you can do it for the current axes (i.e. 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
Each variable above will be a 1-by-2 array containing the minimum and maximum values for the respective axis. You can check the documentation on axes properties for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With