<< mesh Matlab-like plotting library plot >>

Matlab-like plotting library >> Matlab-like plotting library > pcolor

pcolor

Pseudo color 2-D plot

Calling Sequence

hdl = pcolor(X,Y,C)

Parameter

X

1 by n matrix or n by n matrix

Y

1 by n matrix or n by n matrix

C

n by n matrix

hdl

Handle of the created Fac3d entity

Description

pcolor(x,y,C) plots the colored rectangular or non rectangular 2D patches defined by three arguments

The axis labels are determined by the range of X, Y or by a 'axis' property setting. The color of the patch is determined by the matrix C. The entries of C are scaled to correspond to the current colormap entries (see caxis and colormap).

When x,y and C are matrices of the same size, pcolor(x,y,C) plots the colored patches of vertices (x(i,j), y(i,j)) and color C(i,j).

When x,y are vector arguments you must have length(x) = n and length(y) = m where [m,n] = size(C).In this case, the vertices of the (rectangular) patches are the couples (x(j), y(i)). Note that x corresponds to the columns of C and y corresponds to the rows. Example :

r=linspace(0,1,25);
theta=%pi/4+linspace(0,3*%pi/2,25);
[R,T]=meshgrid(r,theta);
pcolor(R.*cos(T),R.*sin(T),exp(-2*R.^2));
shading interp
colorbar on
axis equal

Note that surf(Z) uses x = 1:n and y = 1:m. When f is a function/macro and x,y are vectors, pcolor(x,y,f) produces a 2D plot corresponding to a parametric or non parametric surface defined by f :

Examples

[R,T]=meshgrid(linspace(0,1,25),%pi/4+linspace(0,3*%pi/2,25)); 
drawlater
pcolor(R.*cos(T),R.*sin(T),rand(T));
shading interp 
colorbar on
axis equal
drawnow

Screenshot

See Also

Authors


Report an issue
<< mesh Matlab-like plotting library plot >>