Pseudocolor (checkerboard) plot
h = pcolor(...)
A pseudocolor plot is a rectangular array of cells with colors
C. MATLAB® creates a pseudocolor
plot using each set of four adjacent points in
define a surface rectangle (i.e., cell).
colors each cell with a single color. The last row and column of
C are not
used in this case. With
interp, each cell is colored by interpolating the colors at its four
vertices, using all elements of
The minimum and maximum elements of
assigned the first and last colors in the colormap. Colors for the
remaining elements in
C are determined by a linear
mapping from value to colormap element.
pcolor(X,Y,C) draws a
pseudocolor plot of the elements of
C at the locations
Y. The plot
is a logically rectangular, two-dimensional grid with vertices at
vectors or matrices that specify the spacing of the grid lines. If
X corresponds to the columns of
to the rows. If
matrices, they must be the same size as
plots into the axes with handle
of the current axes (
h = pcolor(...) returns
a handle to a
A Hadamard matrix has elements that are
-1. A colormap with only two entries is appropriate when displaying a pseudocolor plot of this matrix.
pcolor(hadamard(20)) colormap(gray(2)) axis ij axis square
A simple color wheel illustrates a polar coordinate system.
n = 6; r = (0:n)'/n; theta = pi*(-n:n)/n; X = r*cos(theta); Y = r*sin(theta); C = r*cos(2*theta); pcolor(X,Y,C) axis equal tight
A pseudocolor plot is a flat surface plot viewed from above.
the same as viewing
When you use
the constant color of each cell is the color associated with the corner
having the smallest x-y coordinates.
C(i,j) determines the color of the cell
in the ith row and jth column.
The last row and column of
C are not used.
When you use
shading interp, each cell's color results from an
interpolation of the colors at its four vertices, and all elements of
imagesc function to display image data. Each
function displays a rectangular array of cells and uses
determine the colors.
pcolor(C) uses the values in
define the vertex colors by scaling the values to map to the full
range of the colormap. The size of
the number of vertices.
pcolor determines the cell
colors using the colors defined at the cell vertices.
define the cell colors by mapping the values directly into the colormap.
The size of
C determines the number of cells.
define the cell colors by scaling the values to map to the full range
of the colormap. The size of
C determines the number
pcolor(X,Y,C) can produce parametric grids,
which is not possible with