Learn R Programming

cba (version 0.2-6)

plotting: Matrix Image Plots

Description

Provides methods for proper plotting objects of class matrix and dist.

Usage

## S3 method for class 'matrix':
image(x, xlab = "", ylab = "", ...)

## S3 method for class 'dist': image(x, xlab = "", ylab = "", ...)

Arguments

x
an object of class matrix or dist.
xlab, ylab
labels for the x and y axis.
...
further arguments to image.

Details

Plots an object of class matrix in its original row and column orientation. This means, in a plot the columns become the x-coordinates and the reversed rows the y-coordinates.

If x is of class dist it is converted to full-storage representation and dispatched to the matrix method.

See Also

image for details.

Examples

Run this code
x <- matrix(sample(c(FALSE, TRUE),100,rep=TRUE),ncol=10)
image(x)
image(x, col=c("white","black"))
axis(1)				# the columns
axis(2, at=c(1,3,5,7,9), labels=c(9,7,3,5,1))	# the reversed rows

Run the code above in your browser using DataLab