Rev 25360 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{identify}\alias{identify}\alias{identify.default}\title{Identify Points in a Scatter Plot}\usage{identify(x, \dots)\method{identify}{default}(x, y = NULL, labels = seq(along = x), pos = FALSE,n = length(x), plot = TRUE, offset = 0.5, \dots)}\arguments{\item{x,y}{coordinates of points in a scatter plot. Alternatively, anyobject which defines coordinates (a plotting structure, timeseries etc.) can be given as \code{x} and \code{y} left undefined.}\item{labels}{an optional vector, the same length as \code{x} and\code{y}, giving labels for the points.}\item{pos}{if \code{pos} is \code{TRUE}, a component is added to thereturn value which indicates where text was plotted relative to eachidentified point (1=below, 2=left, 3=above and 4=right).}\item{n}{the maximum number of points to be identified.}\item{plot}{if \code{plot} is \code{TRUE}, the labels are printed atthe points and if \code{FALSE} they are omitted.}\item{offset}{the distance (in character widths) which separates thelabel from identified points.}\item{\dots}{further arguments to \code{par(.)}.}}\description{\code{identify} reads the position of the graphics pointer when the(first) mouse button is pressed. It then searches the coordinatesgiven in \code{x} and \code{y} for the point closest to the pointer.If this point is close to the pointer, its index will be returned aspart of the value of the call.}\details{If in addition, \code{plot} is \code{TRUE}, the point is labelled withthe corresponding element of \code{text}.The labels are placed either below, to the left, above or to the rightof the identified point, depending on where the cursor was.#ifdef unixThe identification process is terminated by pressing any mouse buttonother than the first.#endif#ifdef windowsThe identification process is terminated by clicking the second buttonand selecting \sQuote{Stop} from the menu, or from the \sQuote{Stop}menu on the graphics window.#endifOn most devices which support \code{locator}, successful selection ofa point is indicated by a bell sound unless\code{\link{options}(locatorBell=FALSE}} has been set.If the window is resized or hidden and then exposed before the identificationprocess has terminated, any labels drawn by \code{identify}will disappear. These will reappear once the identification process hasterminated and the window is resized or hidden and exposed again.This is because the labels drawn by \code{identify} are notrecorded in the device's display list until the identification process hasterminated.}\value{If \code{pos} is \code{FALSE}, an integervector containing the indexes of the identified points.If \code{pos} is \code{TRUE}, a list containing a component\code{ind}, indicating which points were identified and a component\code{pos}, indicating where the labels were placed relative to theidentified points.}\references{Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)\emph{The New S Language}.Wadsworth \& Brooks/Cole.}\seealso{\code{\link{locator}}}\keyword{iplot}