minbars | R Documentation |
A bar plot.
minbars(height, unit = NULL, horiz = TRUE, min = 0, ...)
height |
an integer vector of counts for each bar |
unit |
the units of |
horiz |
logical; if |
min |
bars less than |
... |
additional arguments passed to |
prettybars
; prettybars2
; bibar
set.seed(1)
layout(matrix(c(1, 1, 1, 2:4), 3), widths = c(1, 1.5))
op <- par(las = 1L, mar = c(1, 1, 2, 2))
minbars(table(rbinom(500, 15, 0.5)), unit = 'Billion',
col = adjustcolor('tomato4', alpha.f = 0.5))
mtext('Group 1', at = par('usr')[1L], adj = 0)
for (ii in 1:3) {
minbars(table(rbinom(500, 15, 0.5)), unit = 'Million', min = 10,
horiz = FALSE, col = adjustcolor(ii, alpha.f = 0.5))
if (ii == 2L)
abline(h = grconvertY(0:1, 'nfc'), xpd = TRUE)
text(0, mean(par('usr')[3:4]), paste('Group', ii + 1L),
xpd = NA, srt = 90, adj = c(0.5, -1), cex = 1.5)
}
par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.