Learn R Programming

plotrix (version 1.41)

cluster.overplot: Shift overlying points into clusters.

Description

cluster.overplot checks for overlying points in the x and y coordinates passed. Those points that are overlying are moved to form a small cluster of up to nine points. For large numbers of overlying points, see count.overplot or sizeplot.

Usage

cluster.overplot(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.
tol
The largest distance between points that will be considered to be overlying. Defaults to 1/1000 of the plot range.

Value

  • A list with two components. For unique x-y pairs the elements will be the same as in the original. For overlying points up to eight additional points will be generated that will create a cluster of points instead of one.

See Also

count.overplot,sizeplot

Examples

Run this code
xy.mat<-cbind(sample(1:10,100,TRUE),sample(1:10,100,TRUE))
 plot(cluster.overplot(xy.mat))

Run the code above in your browser using DataLab