contour
Contour plot
contour(x,y,z)
contour(x,y,z,'nolines',numLevels)
contour(x,y,z,'nolines',levels)
contour(x,y,z,levels)
contour(x,y,z,numLevels)
Inputs
x The array of x coordinates of the grid points at which the function is defined.
y The array of y coordinates of the grid points at which the function is defined.
z The two dimensional array of the function values at the grid points.
numLevels The number of levels of the function at which to draw the contour lines.
levels The array values of levels of the function at which to draw the contour lines.
'nolines' A flag to suppress the drawing of contour lines.


Description
Draws a contour plot of z .

If x and y are vectors of sizes n and m , respectively, the z should be an mXn matrix, with the element z[i][j] corresponding to the value of the function at the point (x[j],y[i]).

Otherwise, all of the first three of the inputs should be matrices of the same size, with the element z[i,j] corresponding to the value of the function at the point (x[i,j],y[i,j]).

The latter form of the function call may be used to draw contours of functions with parametric coordinates.


Example
>>x=[0:.01:1]
>>z=sin(pi*x')*cos(pi*x);
>>subplot(2,1,1);
>>contour(x,x,z)
>>(x,y)=meshgrid(x,x);
>>w=x+i_y;
>>z=w.^.5
>>subplot(2,1,2);
>>contour(real(z),imag(z),abs(z))