Learn R Programming

TIMP (version 1.13.6)

divergeZimage: Plots a matrix with a diverging palette, with the center value of the palette possible to set

Description

An image plot of a matrix is a way of visualizing data; when the data represents a quantity like transient absorption, where negative values represent a different phenomena than positive values, it can be useful to set values at zero in the image plot to grey, whereas positive values are assigned to red, and negative values are assigned to blue. Alternately, when comparing image plots of several matrices, it may be useful to set the value assigned to grey uniformly, with values above this threshold assigned to red, and below this threshold assigned to blue.

Usage

divergeZimage(ob, out=FALSE, file="divergeZimage.pdf",
                            lin = 1, title = "", center = 0,
                            x2 = vector(), x= vector(),
                            plainmat = FALSE, ylab="wavelength (nm)",
                            xlab = "time (ns)")

Value

No return value, called for side effects

Arguments

ob

either an object of class dat or a numeric matrix; if a numeric matrix is given then set plainmat=TRUE and specify labels for the columns of matrix in x2 and for the rows of the matrix in x

out

a logical indicating whether to write to the screen in the case that this is possible or to a file; if TRUE, writes to a pdf file

file

a character vector giving a filename to write to in the case that out=TRUE

lin

range of x to plot linearly; values not between -lin and lin are plotted on a log scale

title

character vector giving a title for the plot

center

point assigned to grey in the diverging palette.

x2

vector of labels for the columns of the matrix; used only if plainmat=TRUE

x

vector of labels for the rows of the matrix; used only if plainmat=TRUE

plainmat

logical indicating whether ob is a matrix, as opposed to an object of class dat

ylab

character vector giving a label to put on the y-axis

xlab

character vector giving a label to put on the x-axis

Author

Katharine M. Mullen, Ivo H. M. van Stokkum

See Also

dat

Examples

Run this code

exd <- dat(psi.df=matrix(rnorm(1000), ncol=100, nrow=100),
x=1:100,x2=1:100, nl=as.integer(100), nt=as.integer(100))

## by default linear range until 1 is used, logarithmic thereafter
divergeZimage(exd)

## can change this as desired
divergeZimage(exd, lin=10, title="plot linearly to 10")

Run the code above in your browser using DataLab