\Header{imageplot}{Image Plot of Microarray Statistics}
\keyword{hplot}{imageplot}
\begin{Description}\relax
Creates an image of shades
of gray or colours, that represents the values of a statistic for each
spot on the array.
The statistic can be a log intensity ratio, quality
information such as spot size or shape, or a t-statistic.
This function can be used to explore whether there are any spatial effects in the data.
\end{Description}
\begin{Usage}
\begin{verbatim}
imageplot(z, layout, low = NULL, high = NULL, ncolors = 123, zerocenter = NULL, 
zlim = NULL, mar=rep(1,4), ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{z}] numeric vector or array. This vector can contain any spot 
statistics, such
as log intensity ratios, spot sizes or shapes, or t-statistics. Missing values 
are allowed and will result in blank spots on the image.
\item[\code{layout}] a list specifying the dimensions of the spot matrix
and the grid matrix.
\item[\code{low}] color associated with low values of \code{z}. May be specified as a character string 
such as \code{"green"}, \code{"white"} etc, or as a rgb vector in which \code{c(1,0,0)} is red, 
\code{c(0,1,0)} is green and \code{c(0,0,1)} is blue. The default value is \code{"green"} if \code{zerocenter=T} or \code{"white"} if \code{zerocenter=F}.
\item[\code{high}] color associated with high values of \code{z}. The default value is \code{"red"} if \code{zerocenter=T} or \code{"blue"} if \code{zerocenter=F}.
\item[\code{ncolors}] number of color shades used in the image including low and high.
\item[\code{zerocenter}] should zero values of \code{z} correspond to a shade exactly halfway between the colors 
low and high? The default is TRUE if \code{z} takes positive and negative values, 
otherwise FALSE.
\item[\code{zlim}] numerical vector of length 2 giving the extreme values of \code{z} to associate with 
colors \code{low} and \code{high}. By default \code{zlim} is the range of \code{z}. Any values of \code{z} outside 
the interval \code{zlim} will be truncated to the relevant limit.
\item[\code{mar}] numeric vector of length 4 specifying the width of the margin around the plot.
This argument is passed to \code{\Link{par}}.
\item[\code{...}] any other arguments will be passed to the function image
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The image follows the layout of an actual microarray slide with the bottom left corner representing the spot (1,1,1,1). 
This function is very similar to the \code{sma} function \code{plot.spatial} but is intended 
to display spatial patterns and artefacts rather than to highlight extreme 
values. The function differs from \code{plot.spatial} most noticeably in that all the 
spots are plotted and the image is plotted from bottom left rather than from 
top left.
\end{Details}
\begin{Value}
An image is created on the current graphics device.\end{Value}
\begin{Author}\relax
Gordon Smyth
\end{Author}
\begin{SeeAlso}\relax
\code{\Link{maImage}}, \code{\Link{image}}.

An overview of diagnostic functions available in LIMMA is given in \link{6.Diagnostics}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
M <- rnorm(8*4*16*16)
imageplot(M,layout=list(ngrid.r=8,ngrid.c=4,nspot.r=16,nspot.c=16))
\end{ExampleCode}
\end{Examples}

