Learn R Programming

plotrix (version 2.3-1)

boxed.labels: Place labels in boxes

Description

Places labels in boxes on an existing plot

Usage

boxed.labels(x,y=NA,labels,bg="white",border=TRUE,xpad=0.6,ypad=0.6,
  srt=0,...)

Arguments

x,y
x and y position of the centers of the labels. x can be an xy.coords list.
bg
The fill color of the rectangles on which the labels are displayed.
labels
Text strings
border
Whether to draw borders around the rectangles.
xpad,ypad
Half the value of the proportion of the rectangles to the extent of the text within.
srt
Rotation of the labels. If 90 or 270 degrees, the box will be rotated 90 degrees.
...
additional arguments passed to text.

Value

  • nil

See Also

spread.labels, thigmophobe.labels

Examples

Run this code
x<-rnorm(10)
 y<-rnorm(10)
 plot(x,y,type="p")
 nums<-c("one","two","three","four","five","six","seven","eight","nine","ten")
 boxed.labels(x,y-0.1,nums)
 readline("Press <Enter> to continue")
 # now label a barplot
 xpos<-barplot(c(1,3,2,4))
 boxed.labels(xpos,0.5,nums[1:4])

Run the code above in your browser using DataLab