\name{plotvar.FCS}
\alias{plotvar.FCS}
%- Also NEED an `\alias' for EACH other topic documented here.
\title{Making Univariate/Bivariate plots of the column variables of a FCS object}
\description{
  A univariate histogram or scatterplot will be made for a single column
  variable specified from the data of the FCS object, or a bivariate
  scatterplot or contour-image scatter plot will be shown for any two
  variables specified in the FCS object.
}
\usage{
plotvar.FCS(x, varpos, type = c("uni", "bi"), 
           plotType = c("hist", "ContourScatterPlot", "plot"),
           names.var = NULL, title.pl = "",
           xlimit = NULL, ylimit = NULL, plot.freq = TRUE,
           color.hist.plot = "white", CSPlot = TRUE,
           hexbin.CSPlot=TRUE,
           hexbin.style.CSPlot=c("colorscale", "lattice", "centroids",
                "nested.lattice", "nested.centroids"),
           n.hexbins.CSPlot=100,
           x.grid.CSPlot = seq(0, 1025, by = 25),
           y.grid.CSPlot = seq(0, 1025, by = 25),
           image.col.CSPlot = heat.colors(2),
           numlev.CSPlot = 25,
           xaxt="s", yaxt="s",
           MY.DEBUG = FALSE,...)
}
\arguments{
  \item{x}{FCS object}

  \item{varpos}{the numerical column variable position of the data of
    the FCS object}
  
  \item{type}{character string specifying the type of plot; either "uni"
    for univariate or "bi" for bivariate; currently this option need not
    be specified because of automatic detection within the function}
  
  \item{plotType}{the type of plot to be used; either \code{plot}, \code{hist},
    \code{ContourScatterPlot}; currently this option need not
    be specified because of automatic detection within the function; a
    univariate histogram plot is default when varpos is a single numeric
    value, and a default contour-image scatter plot with hexagonal
    binning or rectangular binning is displayed for a bivariate plot.}

  \item{names.var}{(optional) character string or vector of characte strings
    of the variable or variables to be plotted; default is NULL and will
    be changed to the names specified in the data of the FCS object}
  
  \item{title.pl}{character string of the plot title (main)}
  
  \item{xlimit}{numerical vector of the range of the x variable
    (horizontal axis)}
  
  \item{ylimit}{numerical vector of the range of the y variable
    (vertical axis)}
  
  \item{plot.freq}{boolean; if TRUE, then the frequencies instead of the
    relative frequencies are plotted (only if plotType=hist)}
  
  \item{color.hist.plot}{character string or numerical value indicating
    the color of the histogram plot}
  
  \item{CSPlot}{a boolean of whether or not this is a
    ContourScatterPlot; if FALSE then an ordinary scatterplot is
    produced}

  \item{hexbin.CSPlot}{boolean; if TRUE then the grid
    cells/compartments are hexagons; otherwise the grid cells are
    rectangular; default value is TRUE}

  \item{hexbin.style.CSPlot}{the style of hexbin plot; default is
    "colorscale" (for ContourScatterPlot hexagonal binning ONLY!) }
  
  \item{n.hexbins.CSPlot}{number of xbins for hexagon binning; default
    is 100 (for ContourScatterPlot hexagonal binning ONLY!)}
  
  \item{x.grid.CSPlot}{a numeical sequence denoting the grid marks for
    the x coordinate (for ContourScatterPlot rectanglar binning ONLY!)}
  
  \item{y.grid.CSPlot}{a numerical sequence denoting the grid marks for
    the y coordinate (for ContourScatterPlot rectanglar binning ONLY!)}
  
  \item{image.col.CSPlot}{a color map for the image (for
    ContourScatterPlot rectanglar binning ONLY!)}
  
  \item{numlev.CSPlot}{number of levels for the contours in a ContourScatterPlot (for
    ContourScatterPlot rectanglar binning ONLY!)}
  
   \item{xaxt}{if "s", then the x-axis is plotted, if "n" then there is no
    x-axis plotted (for
    ContourScatterPlot rectanglar binning ONLY!)}

  \item{yaxt}{if "s", then the y-axis is plotted, if "n" then there is no
    y-axis plotted (for
    ContourScatterPlot rectanglar binning ONLY!)}

  \item{MY.DEBUG}{boolean; if TRUE then the variable check statements are
    printed; default is FALSE}

  \item{...}{\code{plot} options (for histograms and ContourScatterPlot
    hexagonal binning) or \code{contour} options for ContourScatterPlot
    rectangular binning}
}
\details{
  Other options from the functions \code{\link{plot}},
  \code{\link{hist}}, \code{\link{ContourScatterPlot}} may be
  used in the signature of this function to define the plot further.
}
\value{
  Either a univariate or a bivariate plot of the specified variable(s)
  of the FCS object.  A \code{\link{hist}} plot will output the breaks
  and bins of the  histogram.
}
\author{A.J. Rossini and J.Y. Wan}
\note{
  For a description of colors please look up \code{\link[grDevices]{colors}},
  \code{\link[grDevices]{palette}}, and
    \code{\link[grDevices:palettes]{heat.colors}} 
}
\section{WARNING}{Please read the warning for \code{\link{ContourScatterPlot}}.}
\seealso{\code{\link{ContourScatterPlot}},
  \code{\link{plot}}, \code{\link{hist}}}
\examples{

  ### to identify all the colors available on your system
  colors()
  if (interactive()) {
    if (require(rfcdmin)) {

      if (!is.element("unst.1829", objects())) {
        ## obtaining the FCS objects from VRC data
        data(VRCmin)
      }

      ## univariate plot
      plotvar.FCS(unst.1829, varpos=1)

      ## bivariate plot :hexagonal binning
      plotvar.FCS(unst.1829, varpos=c(1,2))

      ## bivariate plot :rectangonal binning
      plotvar.FCS(unst.1829, varpos=c(1,2), hexbin.CSPlot=FALSE)
    }
  }

}
\keyword{hplot}