12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

contourPurpose2contourTwo-dimensional contour plotSyntaxDescriptioncontour(Z)contour(Z,n)contour(Z,v)contour(X,Y,Z)contour(X,Y,Z,n)contour(X,Y,Z,v)contour(...,LineSpec)[C,h] = contour(...)A contour plot displays isolines of matrix Z. Label the contour lines usingclabel.contour(Z) draws a contour plot of matrix Z, where Z is interpreted as heightswith respect to the x-y plane. Z must be at least a 2-by-2 matrix. The numberof contour levels and the values of the contour levels are chosen automaticallybased on the minimum and maximum values of Z. The ranges of the x- andy-axis are [1:n] and [1:m], where [m,n] = size(Z).contour(Z,n) draws a contour plot of matrix Z with n contour levels.contour(Z,v) draws a contour plot of matrix Z with contour lines at the datavalues specified in vector v. The number of contour levels is equal to length(v).To draw a single contour of level i, use contour(Z,[i i]).contour(X,Y,Z), contour(X,Y,Z,n), and contour(X,Y,Z,v) draw contourplots of Z. X and Y specify the x- and y-axis limits. When X and Y are matrices,they must be the same size as Z, in which case they specify a surface as surfdoes.contour(...,LineSpec) draws the contours using the line type and colorspecified by LineSpec. contour ignores marker symbols.[C,h] = contour(...) returns the contour matrix C (see contourc) and avector of handles to graphics objects. clabel uses the contour matrix C to createthe labels. contour creates patch graphics objects unless you specify LineSpec,in which case contour creates line graphics objects.2-100

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!