Axes Limits
We can modify the visible ranges of the x, y, and z axes by the following functions.
xlim([<left_limit> <right_limit>])
ylim([<left_limit> <right_limit>])
zlim([<left_limit> <right_limit>])
This will display the respective axes only in the given range.
Example 7:
Matlab
% % MATLAB code for Axes Limits x = linspace(-35,35,10000); plot(x,sin(x)+cos(x)) % Defining x limits xlim([-pi pi]) % Defining y limits ylim([-2 2]) legend( 'Sin(x) + Cos(x)' ) |
Output:
Axes Appearance and Behavior in MATLAB
MATLAB offers many types of axes such as polar axes, cartesian axes, etc. The default appearances of these axes are dynamically determined by MATLAB on case-by-case requirements. However, MATLAB does provide its users the option to alter the behavior of these axes, by using some built-in functions. In this article, we shall how we can use these functions to alter the appearance of cartesian axes; the same methods could be applied to polar axes and other available axis types.
Contact Us