Learn R Programming

transport (version 0.15-4)

matimage: Plotting Matrices as Images

Description

A simple wrapper to the image function with a more convenient syntax for plotting matrices "the right way round" as pixel images.

Usage

matimage(z, x = 1:dim(z)[1], y = 1:dim(z)[2], rot = TRUE, asp = 1, ...)

Value

Nothing (invisible NULL).

Arguments

z

a numeric matrix.

x, y

(optional) coordinates of the pixels.

rot

logical. Whether to plot the matrix "the right way round" so that the pixel position in the image corresponds to the pixel position in the matrix obtained by print.

asp

the aspect ratio parameter of image.

...

further parameters passed to image.

Examples

Run this code
m <- matrix(1:36,6,6)
image(z=m, col = heat.colors(36))
matimage(m, col = heat.colors(36))

Run the code above in your browser using DataLab