imagem: imagem

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

A variant of image, adapted to matrices. imagem keeps the aspect ratio and orientation of the matrix. Row names and column names are shown if available. Arguments correspond to those of image as far as possible.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
imagem(z, 
	zlim, 
	xlim = c(1, ncol(z)), 
	ylim = c(1, nrow(z)), 
	palette = heat.colors(12), 
	add = FALSE, 
	xaxs = "i", yaxs = "i", 
	xlab, ylab, 
	main= deparse(substitute(z)), 
	pars,
	aspz,
	mar = c(1, 1, 2, 1) + 0.1, 
	breaks, 
	oldstyle = FALSE, 
	names = TRUE, ...)

Arguments

z

a matrix containing the values to be plotted (NAs are allowed). Note that x can be used instead of z for convenience.

zlim

the minimum and maximum z values for which colors should be plotted, defaulting to the range of the finite values of z. Each of the given colors will be used to color an equispaced interval of this range. The midpoints of the intervals cover the range, so that values just outside the range will be plotted.

xlim, ylim

ranges for the plotted x and y values, defaulting to the ranges of x and y.

palette

a list of colors such as that generated by rainbow, heat.colors, topo.colors, terrain.colors or similar functions.

add

logical; if TRUE, add to current plot (and disregard the following four arguments). This is rarely useful because image ‘paints’ over existing graphics.

xaxs, yaxs

style of x and y axis. The default "i" is appropriate for images. See par.

xlab, ylab

each a character string giving the labels for the x and y axis. Default to the ‘call names’ of x or y, or to "" if these were unspecified.

main

main title.

pars

graphical parameters, see par. See details

aspz

Applied as a scaling factor to to nrow(z)/ncol(z). The aspect ratio of the display will be adjusted to a near match, taking into accout margin space as required.

mar

margin. Margin space for row and column labels will be added.

breaks

a set of breakpoints for the colours: must give one more breakpoint than colour.

oldstyle

logical. If true the midpoints of the colour intervals are equally spaced, and zlim[1] and zlim[2] were taken to be midpoints. The default is to have colour intervals of equal lengths between the limits.

names

boolean. If TRUE, row names and column names are shown.

...

graphical parameters for plot may also be passed as arguments to this function, as can the plot aspect ratio asp and axes (see plot.window).

Details

If pars is undefined, default parameters are selected, based on the data values and labels. The picture aspect ratio is chosen to allocate unit squares to each data cell. If pars is NULL, no graphical parameters are changed, else pars is passed to par

Row and column names are displayed in the margins. Adjust mar or adjust the font size if necessary.

Value

A list of graphical parameters, used to set par is returned as invisible result. Use this to generate series of plots with comparable geometry-

This is subject to change.

Note

imagem is a low-level variant of image. For higher level access, use image.bertin.

Author(s)

G. Sawitzki

See Also

image for a general purpose variant.

bertinrect for a representation using a Bertin matrix plot.

Examples

1
2
3
4
5
6
7
nrow <- 3; ncol <- 5
zunif <- matrix(runif(nrow*ncol), nrow, ncol)
colnames(zunif) <- colnames(zunif, do.NULL=FALSE)
 rownames(zunif) <- rownames(zunif, do.NULL=FALSE)
imagem(zunif, yaxt="n")

imagem(zunif, yaxt="n", aspz=0.5*(nrow(zunif)/ncol(zunif)))

bertin documentation built on May 2, 2019, 5:54 p.m.

Related to imagem in bertin...