tracebar | R Documentation |
Draw a barplot
with polygons tracing each row.
tracebar(height, col = NULL, pad = 0.05, alpha = 0.75, ...)
height |
a matrix of data describing the bars which make up the plot, usually a main/total bar and one or more smaller or subsets of the total; bars are grouped by columns; the first row will be the main bar and other rows will be minor bars |
col |
colors for each row of |
pad |
numeric vector of length one or two controlling the horizontal and vertical padding, respectively |
alpha |
numeric value in |
... |
additional arguments passed to |
A numeric vector with the midpoint of each main bar (i.e., identical to a
call to barplot(..., beside = FALSE)
).
Additionally, a list attribute (attr(., "coords")
) where each list
element corresponds to a group of bars. The matrices contain coordinates
of each rectangle plus midpoints.
inbar
set.seed(1)
tbl <- sapply(1:3, function(x) sort(rpois(3, 10), decreasing = TRUE))
tracebar(tbl)
tracebar(replace(tbl, 5, 0), col = 1:3, space = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.