pies: Plots a pie graph.

View source: R/pies.r

piesR Documentation

Plots a pie graph.

Description

This function plots a pie graph. Unlike pie, it can be used to add a pie graph to an existing plot.

Usage

pies(
  x,
  add = FALSE,
  xPos = 0,
  yPos = 0,
  radius = 0.8,
  col = base::seq_along(x),
  border = "black",
  aspect = TRUE,
  ...
)

Arguments

x

a Numeric vector of non-negative numerical quantities. These values are displayed as the areas of pie slices.

add

Logical, if TRUE then add the pie to an existing plot. If FALSE then the arguments are passed to pie. In this case then all arguments default to their interpretation in that function.

xPos

Numeric, the x-coordinate of the center of the pie (ignored if add is FALSE).

yPos

Numeric, the y-coordinate of the center of the pie (ignored if add is FALSE).

radius

Numeric, radius of pie in plot units.

col

Character or integer, color(s) with which to fill pie slices.

border

Character or integer, color(s) with which to draw border of pie slices.

aspect

Logical, if TRUE (default) then force a 1:1 aspect ratio of the pie relative to the plot axes. If the aspect ratio of the plot is not 1:1 then radius will equal the radius along the x-axis and the y-axis radius will be shrunk.

...

Arguments to pass to polygon if add = TRUE or pie if add = FALSE.

See Also

pie polygon

Examples

plot(0, 0, xlim=c(-1, 1), ylim=c(-1, 1))
pies(1:3, add=TRUE)
pies((1:10)^2, add=TRUE, xPos=1, yPos=0.5, radius=0.2)
pies(c(1, 10), add=TRUE, xPos=-0.5, yPos=0, radius=0.4)

adamlilith/legendary documentation built on July 28, 2023, 8:13 p.m.