Multiple Plots on the same axes
As seen in the previous example, we can add multiple plots on the same axes using the hold trigger. The syntax of the same is:
hold on
plot1
plot2
.
.plot N
hold off
This will plot all the plots that are written in between the hold-on and hold-off commands.
Example 5
The plot of linear, quadratic, and cubic polynomials of y=x.
Matlab
% % MATLAB code for Multiple Plots % on the Same axes x = linspace(-3,3,10000); hold on plot(x,.1*x) plot(x,.1*x.^2) plot(x,.1*x.^3) hold off |
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