\HeaderA{cPlot}{A plotting function for chromosomes.}{cPlot}
\keyword{utilities}{cPlot}
\begin{Description}\relax
Given a chromLocation object, will plot all the gene locations from
that object.
\end{Description}
\begin{Usage}
\begin{verbatim}
cPlot(plotChroms, useChroms=chromNames(plotChroms),
      scale=c("relative","max"), fg="white", bg="lightgrey", 
      glen=0.4, xlab="", ylab="Chromosome",  main = organism(plotChroms))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{plotChroms}] An object of type chromLocation which contains all
the gene information to be plotted. 
\item[\code{useChroms}] A vector of chromosome names to be used in the plot.
Default is to use all the chromosomes from the plotChroms object.
\item[\code{scale}] Passed on to cScale as it's scale argument.  Determines
whether the graph is scaled on a relative or absolute basis.
\item[\code{fg}] The colour to be used for the genes.  Default is white.
\item[\code{bg}] The colour to be used for the background of the plot.
Defaults to lightgrey/
\item[\code{glen}] A scaling factor applied to the plotted length of each
gene.  Defaults to 0.4 - it is recommended that this not be set
larger then 0.5 as it will cause overlap between chromosomes.
\item[\code{xlab}] A label for the x axis.
\item[\code{ylab}] A label for the y axis.
\item[\code{main}] A main label for the plot.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function will first use the lengths of the chromosomes, stored in
the object to create scaling factors for the X axis.  Once the
scaling factors are determined, the \code{chromLocation} object which is
passed in is used to determine all the gene locations/strand
information/etc, which is then plotted for the user.
\end{Details}
\begin{Author}\relax
Jeff Gentry
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{cScale}{cScale}}, \code{\LinkA{cColor}{cColor}},
\code{\LinkA{chromLocation-class}{chromLocation.Rdash.class}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
   ## A bit of a hack to not have a package dependency on hgu95av2
   ## but need to fiddle w/ the warn level to not fail the example anyways.
   curWarn <- options(warn=0)
   on.exit(options(warn=curWarn), add=TRUE)
   if (require(hgu95av2)) {
    z <- buildChromLocation("hgu95av2")

     if (interactive()) {
       par(ask=TRUE)
     }

     for (sc in c("max","relative"))
       cPlot(z,c("1","5","10","X","Y"),sc)
  } else print("This example can not be run without hgu95av2 data package")
\end{ExampleCode}
\end{Examples}

