matimage: Plotting Matrices as Images

View source: R/lilhelpers.R

matimageR Documentation

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, ...)

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.

Value

Nothing (invisible NULL).

Examples

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

transport documentation built on Sept. 17, 2024, 1:08 a.m.