\name{legend.CSP} \alias{legend.CSP} %- Also NEED an '\alias' for EACH other topic documented here. \title{Makes a rough legend for the ContourScatterPlot } \description{ The color scheme used for the \link{image} plot within the \link{ContourScatterPlot} is scaled according the rough estimates of the breaks. Any white-colored cells in an \link{image} or \link{ContourScatterPlot} is considered to be NA. } \usage{ legend.CSP(z, n, border = if (n < 32) "light gray" else NA, main = paste("color palettes; n=", n), ch.col = c("rainbow(n, start=.7, end=.1)", "heat.colors(n)", "terrain.colors(n)", "topo.colors(n)", "cm.colors(n)"), breaks = seq(range(z, na.rm = TRUE)[1], range(z, na.rm = TRUE)[2], by = diff(range(z, na.rm = TRUE))/n)) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{z}{The matrix grid used for the \link{image} plot; this matrix is produced via \link{make.grid} or \link{make.density} } \item{n}{The number of color levels} \item{border}{ The border of the legend plot} \item{main}{ The main title of the legend plot} \item{ch.col}{ the color palette used } \item{breaks}{ the breaks used to scale the color scheme} } \details{ This legend is used as a rough approximation and is produced in a plot entirely separate. } \value{ Plot of the color scheme scaled by ranges of the values of the grid cells in the \link{image} plot produced by 'z' input. } \references{ The code was obtained from the example of \link[grDevices]{heat.colors}} \author{A.J. Rossini and J.Y. Wan} \seealso{ \code{\link[grDevices]{heat.colors}}, \code{\link{ContourScatterPlot}}, \code{\link{image}}} \examples{ if (require(rfcdmin)){ data.there<-is.element(c("st.1829", "unst.1829", "st.DRT", "unst.DRT"),objects()) if ( ( sum(data.there) != length(data.there) )){ ## obtaining the FCS objects from VRC data data(VRCmin) } var1<-st.DRT@data[,4] var2<-st.DRT@data[,5] col.nm<-colnames(st.DRT@data) ## matrix of counts count.output1<-make.grid(var1, var2) mat.counts1<-count.output1$z if (interactive()){ par(mfrow=c(2,2)) image(mat.counts1, main="make.grid: Counts for stimulated", xlab=col.nm[4],yaxt="n", xaxt="n", ylab=col.nm[5], col=heat.colors(20)) ## legend describes the counts in each cell legend.CSP(mat.counts1, 20, ch.col="heat.colors(n)") image(mat.counts1,yaxt="n", xaxt="n", main="make.grid: Counts for stimulated", xlab=col.nm[4], ylab=col.nm[5], col=topo.colors(20)) legend.CSP(mat.counts1, 20, ch.col="topo.colors(n)") } } } \keyword{hplot}% at least one, from doc/KEYWORDS