Learn R Programming

plotrix (version 1.2-2)

spread.labels: Spread labels for irregularly spaced values

Description

Places labels for irregularly spaced values in a regular staggered order

Usage

spread.labels(x,y,labels=NULL,offset,col="white",border=FALSE,...)

Arguments

x,y
x and y data values
labels
text strings
offset
How far away from the data points to place the labels.
col
The color of the background rectangles on which to place the labels.
border
Whether to draw a border around the labels.
...
additional arguments passed to boxed.labels.

Value

  • nil

Details

This function is mainly useful when labeling irregularly spaced data points that are "spread out" along one dimension. It places the labels regularly spaced and staggered on the long dimension of the data, drawing lines from each label to the point it describes.

See Also

boxed.labels

Examples

Run this code
x<-rnorm(10)/10
 y<-sort(rnorm(10))
 plot(x,y,xlim=c(-1,1),type="p")
 nums<-c("one","two","three","four","five","six","seven","eight","nine","ten")
 spread.labels(x,y,nums,0.5)

Run the code above in your browser using DataLab