\HeaderA{maColorBar}{Calibration bar for color images}{maColorBar}
\keyword{aplot}{maColorBar}
\keyword{hplot}{maColorBar}
\begin{Description}\relax
This function produces a color image (color bar) which can be used for
the legend to another color image obtained from the functions
\code{\LinkA{image}{image}}, \code{\LinkA{maImage}{maImage}}, or
\code{\LinkA{maImage.func}{maImage.func}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
maColorBar(x, horizontal=TRUE, col=heat.colors(50), scale=1:length(x), k=10, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] If "numeric", a vector containing the "z" values in the
color image, i.e., the values which are represented in the color
image. Otherwise, a "character" vector representing colors.
\item[\code{horizontal}] If \code{TRUE}, the values of \code{x} are
represented as vertical color strips in the image, else, the values
are represented as horizontal color strips.
\item[\code{col}] Vector of colors such as that generated by
\code{rainbow}, \code{heat.colors},
\code{topo.colors}, \code{terrain.colors}, or similar
functions. In addition to these color palette functions, a new
function  \code{\LinkA{maPalette}{maPalette}} was defined to generate color
palettes from user supplied low, middle, and high color values.
\item[\code{scale}] A "numeric" vector specifying the "z" values in the color
image. This is used when the argument \code{x} is a
"character" vector representing color information.
\item[\code{k}] Object of class "numeric", for the number of labels displayed on 
the bar.
\item[\code{...}] Optional graphical parameters, see \code{\LinkA{par}{par}}.
\end{ldescription}
\end{Arguments}
\begin{Author}\relax
Sandrine Dudoit, \url{http://www.stat.berkeley.edu/~sandrine}, Yee Hwa (Jean) Yang.
\end{Author}
\begin{References}\relax
S. Dudoit and Y. H. Yang. (2002). Bioconductor R packages for exploratory analysis and normalization of cDNA microarray data. In G. Parmigiani, E. S. Garrett, R. A. Irizarry and S. L. Zeger, editors, \emph{The Analysis of Gene Expression Data: Methods and Software}, Springer, New York.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{image}{image}}, \code{\LinkA{maImage}{maImage}}, \code{\LinkA{maImage.func}{maImage.func}}, \code{\LinkA{maPalette}{maPalette}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

par(mfrow=c(3,1))
Rcol <- maPalette(low="white", high="red", k=10)
Gcol <- maPalette(low="white", high="green", k=50)
RGcol <- maPalette(low="green", high="red", k=100)
maColorBar(Rcol)
maColorBar(Gcol, scale=c(-5,5))
maColorBar(1:50, col=RGcol)

par(mfrow=c(1,3))
x<-seq(-1, 1, by=0.01)
maColorBar(x, col=Gcol, horizontal=FALSE, k=11)
maColorBar(x, col=Gcol, horizontal=FALSE, k=21)
maColorBar(x, col=Gcol, horizontal=FALSE, k=51)

\end{ExampleCode}
\end{Examples}


