plotrix (version 3.7)

pie.labels: Place labels on a pie chart

Description

Places labels on a pie chart

Usage

pie.labels(x,y,angles,labels,radius=1.05,bg="white",border=TRUE,
  minangle=NA,boxed=FALSE,...)

Arguments

x,y

x and y position of the center of the pie chart

angles

A numeric vector representing angles in radians. This is the return value of floating.pie.

labels

Text strings to label each sector.

radius

The radius at which to place the labels in user units. The default is 1.05.

bg

The color of the rectangles on which the labels are displayed.

border

Whether to draw borders around the rectangles.

minangle

Minimum angle between labels.

boxed

Whether to use text or boxed.labels to display the labels.

...

Arguments passed to text or boxed.labels.

Value

nil

Details

Labels may be placed within the pie (radius less than the pie radius), on the edge or outside as in the examples below. If within the pie, it is probably best to use boxed=TRUE.

If some labels overlap, passing a value in radians for minangle may be used to spread them out.

See Also

floating.pie, boxed.labels, spreadout

Examples

Run this code
# NOT RUN {
 pieval<-c(2,1,3,94)
 plot(1:5,type="n",axes=FALSE,xlab="",ylab="")
 box()
 bisect.angles<-floating.pie(3,3,pieval)
 pie.labels(3,3,bisect.angles,c("two","one","three","ninety\nfour"))
 pie.labels(3,3,bisect.angles,radius=1.5,
  c("First\nvalue","Second\nvalue","Third\nvalue","Fourth\nvalue"),
  minangle=0.2,boxed=TRUE)
# }

Run the code above in your browser using DataCamp Workspace