# contour3

Contour 3D plot of matrix

## Syntax

* contour3(Z)
* contour3(X, Y, Z)
* contour3(..., levels)
* contour3(..., LineSpec)
* contour3(ax, ...)
* M = contour3(...)
* \[M, h] = contour3(...)

## Input argument

* X - x-coordinates: vector or matrix.
* Y - y-coordinates: vector or matrix.
* Z - z-coordinates: vector or matrix.
* levels - Contour levels: scalar or vector.
* LineSpec - Line style and color
* ax - a scalar graphics object value: parent container, specified as a axes.

## Output argument

* M - Contour matrix.
* h - a graphics object: contour type.

## Description

contour3(Z) generates a 3-D contour plot illustrating the isolines of the matrix Z, where Z represents heights on the x-y plane.

The x and y coordinates in the plane correspond to the column and row indices of Z, respectively.

To specify the x and y coordinates for Z values, use contour3(X,Y,Z).

## Example

```matlab
f = figure();
[X,Y,Z] = sphere(50);
[M, C ]= contour3(X,Y,Z);
C.LineWidth = 3;
```

![](https://160667757-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LdPvJ6mJve3gz5MU4d1%2Fuploads%2Fgit-blob-3229886abcc61bd0a2caad459486ded659ee3410%2Fcontour3_1_4EAA1620.svg?alt=media)

## See also

[contour](https://nelson-9.gitbook.io/nelson/markdown/en/graphics/contour), [surf](https://nelson-9.gitbook.io/nelson/markdown/en/graphics/surf), [mesh](https://nelson-9.gitbook.io/nelson/markdown/en/graphics/mesh).

## History

| Version | Description     |
| ------- | --------------- |
| 1.3.0   | initial version |

## Author

Allan CORNET
