# imagesc

Display a matrix as an image with scaled colors.

## Syntax

h = imagesc(z)

h = imagesc(x, y, z)

h = imagesc(..., [cmin cmax])

## Inputs

z
Matrix specifying the data for the matrix to be displayed.
Type: vector | matrix
x
Optional vector to specify the minimum (first element of the vector) and maximum (last element of the vector) values of the x-axis. These values may be used to move or scale the image on the x-axis.
Type: vector | matrix
y
Optional vector to specify the minimum (first element of the vector) and maximum (last element of the vector) values of the y-axis. These values may be used to move or scale the image on the y-axis.
Type: vector | matrix
cmin, cmax
Range of the colormap.
Type: double | integer

## Outputs

h
Handle of the imagesc graphics object.

## Examples

Simple imagesc example:

cla;
z = [1 2 3; 4 5 6; 7 8 9];
imagesc(z)
colorbar

Define the range of the colormap:

cla;
z = [1 2 3; 4 5 6; 7 8 9];
imagesc(z, [3 7]);
colorbar
imagesc with x and y matrices example:
cla;
im1 = imagesc(rand(10,10));
hold on;
im2 = imagesc(11:20, 11:20, rand(10,10));

x and y may be used to scale an image:
cla;
im1 = imagesc(rand(10,10));
hold on;
im2 = imagesc(11:15, 11:15, rand(10,10));