Legends
We can add legends to a set of axes with the help of the legend() function.
Syntax:
legend(text1, …, textN)
Example 4:
Matlab
% % MATLAB code for Legends x = linspace(-3,3,100); hold on plot(x,x.^3) plot(x,x.^2) plot(x,x.^4) hold off % Adding legends legend( "Cubic" , "Quadratic" , "Bi-Quadratic" ) |
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