Learn R Programming

cba (version 0.2-25)

lmplot: Plotting Logical Matrices

Description

Implements a wrapper function to image that produces a black and white or gray-scale plot of a logical matrix.

Usage

lmplot(x, block.size = 1, gray = FALSE, xlab = "", ylab = "", 
       axes = FALSE, ...)

Arguments

x

a logical matrix.

block.size

the interpolation block size.

gray

optionally use a gray scale.

xlab

title for the x axis.

ylab

title for the y axis.

axes

option to plot axes.

...

further arguments to image.

Author

Christian Buchta

Details

TRUE is represented by the color white and FALSE by the color black.

A lower resolution can be obtained by specifying an (interpolation) block size greater than one. Block densities can then be visualized by using the gray scale option. The number of levels of the palette corresponds to the block size but is capped to 8 levels (excluding white). Note that the opacity (blackness) corresponds with density (as on photographic film).

See Also

lminter for interpolating logical matrices and image for further plotting options

Examples

Run this code
###
x <- matrix(sample(c(FALSE, TRUE), 64, rep=TRUE), ncol=8)
lmplot(x)
### use lower resolution
lmplot(x, block.size=2)
### use gray scale
lmplot(x, block.size=2, gray=TRUE)

Run the code above in your browser using DataLab