\Header{points}{Add Points to a Plot}
\alias{points.default}{points}
\keyword{aplot}{points}
\begin{Usage}
\begin{verbatim}
points(x, ...)
points.default(x, y=NULL, type="p", pch=1, col="black", bg=NA, cex=1, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x, y}] coordinate vectors of points to plot.
\item[\texttt{type}] character indicating the type of plotting; actually any of
the \texttt{type}s as in \texttt{\Link{plot}(..)}.
\item[\texttt{pch}] plotting `character', i.e. symbol to use.  \texttt{pch} can
either be a \texttt{\Link{character}} or an integer code for a set of
graphics symbols.  The full set of S symbols is available with
\texttt{pch=0:18}.

In addition, there is a special set of \R\ plotting symbols which
can be obtained with \texttt{pch=19:25} and can be colored and filled
with different colors:
\Itemize{
\item \texttt{pch=19}: solid circle,
\item \texttt{pch=20}: bullet,
\item \texttt{pch=21}: circle,
\item \texttt{pch=22}: square,
\item \texttt{pch=23}: diamond,
\item \texttt{pch=24}: triangle point-up,
\item \texttt{pch=25}: triangle point down.
}

\item[\texttt{col}] color code or name, see \texttt{\Link{colors}},
\texttt{\Link{palette}}.
\item[\texttt{bg}] background (``fill'') color for open plot symbols
\item[\texttt{cex}] character expansion
\item[\texttt{...}] Further graphical parameters (see \texttt{\Link{plot.xy}}
and \texttt{\Link{par}}) may also be supplied as arguments.
\end{ldescription}
\end{Arguments}
\begin{Description}
\texttt{points} is a generic function to draw a sequence of points at
the specified coordinates.  The specified character(s) are plotted,
centered at the coordinates.

Graphical parameters are permitted as arguments to this function.\end{Description}
\begin{SeeAlso}
\texttt{\Link{plot}}, \texttt{\Link{lines}}, and the underlying
``primitive'' \texttt{\Link{plot.xy}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
plot(-4:4, -4:4, type = "n")# setting up coord. system
points(rnorm(200), rnorm(200), col = "red")
points(rnorm(100)/2, rnorm(100)/2, col = "blue", cex = 1.5)

##-------- Showing all the extra & some char graphics symbols ------------
Pex <- if(.Device=="postscript") 5 else 20
ipch <- 1:(np <- 25+11); k <- floor(sqrt(np)); dd <- c(-1,1)/2
rx <- dd + range(ix <- (ipch-1) %/% k)
ry <- dd + range(iy <- 3 + (k-1)-(ipch-1) %% k)
pch <- as.list(ipch)
pch[25+ 1:11] <- as.list(c("*",".", "o","O","0","+","-",":","|","%","#"))
plot(rx, ry, type="n", axes = F, xlab = "", ylab = "",
     main = "plot symbols :  points (..  pch = * )")
abline(v = ix, h = iy, col = "lightgray", lty = "dotted")
for(i in 1:np) {
  pc <- pch[[i]]
  points(ix[i], iy[i], pch = pc, col = "red", bg = "yellow", cex = Pex)
  ## red symbols with a yellow interior (where available)
  text(ix[i] - .3, iy[i], pc, col = "brown", cex = 1.5)
}
\end{ExampleCode}
\end{Examples}

