Learn R Programming

plotrix (version 2.1-5)

floating.pie: Display a floating pie chart

Description

Displays a pie chart at an arbitrary position on an existing plot

Usage

floating.pie(xpos,ypos,x,edges=200,radius=1,col=NULL,startpos=0,
  shadow=FALSE,...)

Arguments

xpos,ypos
x and y position of the center of the pie chart
x
a numeric vector for which each value will be a sector
edges
the number of lines forming a circle
radius
the radius of the pie in user units
col
the colors of the sectors - defaults to rainbow
startpos
The starting position for drawing sectors in radians.
shadow
Logical - whether to draw a shadow
...
graphical parameters passed to polygon

Value

  • The bisecting angle of the sectors in radians. Useful for placing text labels for each sector.

See Also

pie.labels, boxed.labels, polygon.shadow

Examples

Run this code
plot(1:5,type="n",main="Floating Pie test",xlab="",ylab="",axes=FALSE)
 box()
 floating.pie(2,4,c(2,4,6,8),radius=0.5)
 floating.pie(3,3,c(1,4,7,8),radius=0.5)
 floating.pie(4,2,c(3,4,6,7),radius=0.5,shadow=TRUE)

Run the code above in your browser using DataLab