\HeaderA{arrayPlot}{Spatial image of microarray spots statistic}{arrayPlot}
\methaliasA{arrayPlot.arrayCGH}{arrayPlot}{arrayPlot.arrayCGH}
\methaliasA{arrayPlot.default}{arrayPlot}{arrayPlot.default}
\begin{Description}\relax
The function \code{arrayPlot} creates spatial images of shades of gray or colors that correspond to the values of a statistic for each spot on the array. The statistic can be the intensity log-ratio, a spot quality measure (e.g. spot size or shape), or a test statistic. This function can be used to explore whether there are any spatial effects in the data, for example, print-tip or cover-slip effects.
\end{Description}
\begin{Usage}
\begin{verbatim}

arrayPlot.default(Statistic, Col, Row,
                  ArrCol, ArrRow, SpotCol, SpotRow,
                  mediancenter=FALSE,
                  col=myPalette("green","red","yellow"),
                  contour=FALSE, nlevels=5,
                  zlim=zlim, bar=TRUE, ...)

arrayPlot.arrayCGH(arrayCGH, variable,
                   mediancenter=FALSE,
                   col=myPalette("green","red","yellow"),
                   contour=FALSE, nlevels=5,
                   zlim=zlim, bar=TRUE, ...)

\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{arrayCGH}] Object of class \code{\LinkA{arrayCGH}{arrayCGH}}.
\item[\code{variable}] Variable to be plotted
\item[\code{Statistic}] Statistic to be plotted.
\item[\code{Col}] Vector of columns coordinates.
\item[\code{Row}] Vector of rows coordinates.
\item[\code{ArrCol}] Number of columns for the blocs.
\item[\code{ArrRow}] Number of rows for the blocs.
\item[\code{SpotCol}] Number of column for each bloc.
\item[\code{SpotRow}] Number of rows for each bloc.
\item[\code{mediancenter}] If \code{mediancenter=TRUE}, values of \code{Statistic} are median-centered.
\item[\code{col}] List of colors such as that generated by \code{\LinkA{Palettes}{Palettes}}. In addition to these color palettes functions, a new function \code{\LinkA{myPalette}{myPalette}} was defined to generate color palettes from user supplied low, middle, and high color values. 
\item[\code{contour}] If \code{contour=TRUE}, contour are plotted,
otherwise they are not shown.
\item[\code{nlevels}] Numbers of levels added by \code{\LinkA{contour}{contour}} if \code{contour=TRUE}.
\item[\code{zlim}] Numerical vector of length 2 giving the extreme values of
\code{z} to associate with colors \code{low} and \code{high} of
\code{\LinkA{myPalette}{myPalette}}. 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{bar}] If \code{bar=TRUE}, a calibration color bar is shown to the right of the image.
\item[\code{...}] Graphical parameters can be given as arguments to function
\code{\LinkA{image}{image}}.
\end{ldescription}


N.B. : Col takes the values in 1:arrayRow*SpotRow and Row takes the
values in 1:arrayCol*SpotCol
\end{Arguments}
\begin{Details}\relax
This function is very similar to the \code{\LinkA{maImage}{maImage}} written by Sandrine Dudoit with added options \code{zlim} and
\code{mediancenter}.
\end{Details}
\begin{Value}
An image is created on the current graphics device.
\end{Value}
\begin{Author}\relax
Philippe Hupé, \url{http://www.curie.fr}.
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{image}{image}}, \code{\LinkA{contour}{contour}}, \code{\LinkA{arrayPersp}{arrayPersp}}, \code{\LinkA{myPalette}{myPalette}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(arrayCGH)

pdf(file="arrayCGH.pdf",height=21/cm(1),width=29.7/cm(1))
arrayPlot(array2$Log2Rat, array2$Col, array2$Row, 4,4,21,22, main="Spatial Image of array CGH")
dev.off()

# object of class arrayCGH

array <- list(arrayValues=array2, arrayDesign=c(4,4,21,22))
class(array) <- "arrayCGH"

arrayPlot(array,"Log2Rat", main="Spatial Image of array CGH")



\end{ExampleCode}
\end{Examples}

