Learn R Programming

matlab (version 0.7-8)

imagesc: MATLAB imagesc function

Description

Scales image data to the full range of the current pallette and displays the image.

Usage

imagesc(C, ...)

Arguments

C
numeric matrix representing data to be plotted
...
graphical parameters for image may also be passed as arguments to this method

Details

Each element of C corresponds to a rectangular area in the image. The values of the elements of C are indices into the current palette that determine the color of each patch.

The method interprets the matrix data as a table of f(x[i], y[j]) values, so that the x axis corresponds to column number and the y axis to row number, with row 1 at the top, i.e., the same as the conventional printed layout of a matrix.

See Also

image, jet.colors, par

Examples

Run this code
values <- matrix(c(seq(1,  5, by = 1),
                   seq(2, 10, by = 2),
                   seq(3, 15, by = 3)), nrow = 3, byrow = TRUE)
imagesc(values, xlab = "cols", ylab = "rows", col = jet.colors(16))

Run the code above in your browser using DataLab