Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Pseudocolor plot

`pcolor(C)`

`pcolor(X,Y,C)`

`pcolor(ax,___)`

`s = pcolor(___)`

`pcolor(`

creates a pseudocolor plot using the
values in matrix `C`

)`C`

. A pseudocolor plot displays matrix data as an array
of colored cells (known as *faces*). MATLAB^{®} creates this plot as a flat surface in the
*x*-*y* plane. The surface is defined by a grid of
*x*- and *y*-coordinates that correspond to the corners
(or vertices) of the faces. The grid covers the region `X=1:n`

and
`Y=1:m`

, where `[m,n] = size(C)`

. Matrix
`C`

specifies the colors at the vertices. The color of each face depends
on the color at one of its four surrounding vertices. Of the four vertices, the one that
comes first in the *x*-*y* grid determines the color of
the face.

`pcolor(`

specifies the
target axes for the plot. Specify `ax`

,___)`ax`

as the first argument in any of the
previous syntaxes.

`s = pcolor(___)`

returns a `Surface`

object. Use `s`

to set properties on the plot after creating it. For a list
of properties, see Surface Properties.

Use the `pcolor`

, `image`

, and `imagesc`

functions to display rectangular arrays
of colored cells. The relationship between the color matrix `C`

and the
colored cells is different in each case.

`pcolor(C)`

uses the values in`C`

to define the vertex colors by scaling the values to the full range of the colormap. The size of`C`

determines the number of vertices. The values in`C`

map colors from the current colormap to the vertices surrounding each cell.`image(C)`

uses`C`

to define the cell colors by mapping the values directly into the colormap. The size of`C`

determines the number of cells.`imagesc(C)`

uses`C`

to define the cell colors by scaling the values to the full range of the colormap. The size of`C`

determines the number of cells.