pieGrob {toxpiR} | R Documentation |
Create a pie grob
Description
Create a pie grob
Usage
pieGrob(rads, fills = NULL, wts = NULL, name = NULL, vp = NULL, gp = NULL)
grid.pieGrob(rads, fills = NULL, wts = NULL, name = NULL, vp = NULL, gp = NULL)
Arguments
rads |
Numeric, radius values for each slice from 0 to 1 |
fills |
Colors to fill the slices |
wts |
Numeric, the relative portion of each slice |
name , vp , gp |
Passed to grid::gTree |
Details
The default coloring can be set with options("txp.fills")
.
Value
pieGrob
grid::grob object
Examples
library(grid)
s <- seq(0.2, 1, by = 0.1)
grid.newpage()
grid.pieGrob(rads = s)
grid.newpage()
grid.pieGrob(rads = s, wts = s)
curr_txp_fills <- options()$txp.fills
options(txp.fills = 1:8)
grid.newpage()
grid.pieGrob(rads = s)
options(txp.fills = curr_txp_fills)
## Can edit
grid.newpage()
grid.pieGrob(rads = s, name = "myPie")
grid.ls() ## show the grid elements
grid.edit("myPie", fills = 1:9, wts = 9:1)
[Package toxpiR version 1.2.1 Index]