Description Usage Arguments Author(s) See Also Examples
Draw a grid-based pie chart.
1 2 3 |
x |
a vector of non-negative numerical quantities. The values in
|
labels |
one or more expressions or character strings giving names for
the slices. Other objects are coerced by |
edges |
the circular outline of the pie is approximated by a polygon with this many edges. |
radius |
the pie is drawn centred in a square box whose sides range from -1 to 1. If the character strings labelling the slices are long it may be necessary to use a smaller radius. |
clockwise |
logical indicating if slices are drawn clockwise or counter-clockwise (i.e., mathematically positive direction), the latter is default. |
init.angle |
number specifying the starting angle (in degrees)
for the slices. Defaults to 0 (i.e., '3 o'clock') unless |
col |
a vector of colours to be used in filling or shading the
slices. If missing a set of 6 pastel colours is used, unless
|
border |
a vector of colours to be used in drawing the borders of the slices. |
lty |
argument linetype passed to |
Original code by Thomas S. Dye. Modified by Ingo Voglhuber.
gbarplot
, gmatplot
,
gstars
, gsymbols
,
gbxp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | grid.newpage()
gpie(rep(1, 24), col = rainbow(24), radius = 0.9)
grid.newpage()
pie.sales <- c(0.12, 0.3, 0.26, 0.16, 0.04, 0.12)
names(pie.sales) <- c("Blueberry", "Cherry",
"Apple", "Boston Cream", "Other", "Vanilla Cream")
gpie(pie.sales) # default colours
grid.newpage()
gpie(pie.sales,
col = c("purple", "violetred1", "green3",
"cornsilk", "cyan", "white"))
grid.newpage()
gpie(pie.sales, col = gray(seq(0.4,1.0,length=6)))
grid.newpage()
gpie(pie.sales, clockwise=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.