Learn R Programming

plotrix (version 2.0.2)

thigmophobe.points: Shift close points away from each other.

Description

thigmophobe.points checks for x,y points that are closer than tol. Such pairs are moved apart in the dimension which they are closest. Note that clusters of more than two points may not be handled optimally.

Usage

thigmophobe.points(x,y,away=NULL,tol=NULL)

Arguments

x,y
Numeric data vectors or the first two columns of a matrix or data frame. Typically the x/y coordinates of points to be plotted.
away
How far to move overlying points in user units. Defaults to 1/4 the width of a lower case "o" in the x direction and 1/4 of the height of a lower case "o" in the y direction. Because both points are moved, the actual separation will be twice this di
tol
The largest distance between points that will be considered to be overlying. Defaults to 1/2 of the width of a lower case "o" in the x direction and 1/2 of the height of a lower case "o" in the y direction.

Value

  • A list with two components. For x-y pairs farther apart than tol, the elements will be the same as in the original.

Details

thigmophobe.points is most useful where a small number of pairs of points are very close together. When larger clusters occur, use cluster.overplot or count.overplot.

See Also

count.overplot,sizeplot, cluster.overplot

Examples

Run this code
xy.mat<-cbind(rnorm(80),rnorm(80))
 plot(xy.mat,main="Before calling thigmophobe",xlab="X",ylab="Y")
 if(dev.interactive()) par(ask=TRUE)
 plot(thigmophobe.points(xy.mat),main="After calling thigmophobe",
  xlab="X",ylab="Y")
 par(ask=FALSE)

Run the code above in your browser using DataLab