\name{plot.ProbBin.FCS}
\alias{plot.ProbBin.FCS}
\title{Plots a ProbBin.FCS object}
\description{
  A ProbBin.FCS object plot results in two histograms--one for the 
  stimulated sample and one for the unstimulated sample.
}
\usage{
  plot.ProbBin.FCS(x, xlab=x$varname,
               xlim=c(min(c(round(range(x$st.hist$breaks),1) + 1, 
                  round(range(x$unst.hist$breaks),1) + 1)), 
                  max(c(round(range(x$st.hist$breaks),1) + 1, 
                  round(range(x$unst.hist$breaks),1) + 1))),
            
              main="", 
              labels=FALSE, 
              freq=FALSE, plots.made=c("both", "stimulated", "unstimulated"), ...)
}
\arguments{
  \item{x}{ProbBin.FCS object}
  \item{xlab}{Character string of the x-axis; 
     default is the variable name}
 
  \item{xlim}{vector of length 2 denoting the minimum and the maximum value of the 
     breakpoint values, x-axis; default is the minimum and the maximum of the breakpoints
     for both stimulated and unstimulated samples}
 
  \item{main}{character string of the title of the file (ie, individual
    id number)}
  \item{labels}{Boolean; if TRUE, then the number/precentage in each bin is
    printed on the histogram, otherwise it is not; default is FALS}
  \item{freq}{Boolean; if TRUE, then the histogram is in terms of
    counts; if FALSE, then the histogram is in terms of relative
    frequencies/precentages; if TRUE and the areas in plot are wrong
    is output as a warning.}
  \item{plots.made}{character string denoting which histogram plot should be 
   displayed; default is "both"}
 \item{\dots}{plotting options such as 'ylab' and 'ylim'
   to pass to \link{hist}
   }
}
\value{
  Two histograms (one of the stimulated sample, and the other of the
  unstimulated sample) are displayed or only one histogram plot 
  specified by the user will be displayed. 
}
\references{Mario Roederer, et al. "Probability Binning Comparison: A
  Metric for Quantitating Univariate Distribution Differences" Cytometry
  45:37-46 (2001).}
\author{A.J. Rossini \& J.Y. Wan}
\seealso{\code{\link{hist}}, \code{\link{ProbBin.FCS}} }
\examples{

if (require(rfcdmin)){

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


## This only serves as an example.
## Gating/subsetting should precede this analysis
IFN.gamma.1<-unst.1829@data[1:2000,4]
IFN.gamma.2<-st.1829@data[1:2000,4]

#Probability binning using the control dataset to determine the breaks
PB1<-ProbBin.FCS(IFN.gamma.1, IFN.gamma.2, 200,
varname=colnames(unst.1829@data)[4], PBspec="by.control",MY.DEBUG=FALSE)

## Probability Binning using the combined dataset (control and stimulated)
## to determing the breaks
PB2<-ProbBin.FCS(IFN.gamma.1, IFN.gamma.2, 200,
varname=colnames(unst.1829@data)[4], PBspec="combined",MY.DEBUG=FALSE)


if (interactive()){
par(mfrow=c(2,2))
## plots both plots
plot(PB1, ylim=c(0,500),main="Prob Binning using the Control dataset")

## plots only the unstimulated
plot(PB2, main="Prob Binning using the Combined Dataset", plots.made="unstimulated")

## plots only the stimulated
plot(PB2, main="Prob Binning using the Combined Dataset", plots.made="stimulated")
}

}

}

\keyword{hplot}