3D Graphgcdg h
3D Graphgcdg h
plotting facilities
Contour Plots
For example: the level curves of are circles centered at the origin, and the levels are the squares of
the radii of the circles.
[x, y] : x, y interval
contour(list of independent variables,
dependent variable, sequence of of levels)
Meshgrid – Contour
axis square
title('The lemniscate x^2-y^2=(x^2+y^2)^2')
X=-1.1:0.01:1.1;
Y= 1.1:0.01:1.1;
[X Y] = meshgrid(X, Y);
Z= (X.^2 + Y.^2).^2 - X.^2 + Y.^2
contour(X, Y,Z, [0 0])
Multiple plots in a same figure: subplot
subplot(m, n, p) divides the figure window into m×n
small sets of axes, and selects the pth set for the
current plot (numbered by row from the left of the top
row).
To plot z = f(x, y), one begins with a meshgrid command as in the case of
contour.
(MATLAB shades the surface with a color scheme depending on the z-coordinate.
surf (): We could have produced an opaque
surface instead by replacing mesh with surf.