prettyBars {prettyGraphs} | R Documentation |
prettyBars
Description
prettyBars creates simple, crisp, publication-style quality bar graphs.
Usage
prettyBars(data, axis = 1, cex.names = 0.5, fg.col = NULL, axis.lims = NULL,
show.bg.bars = FALSE, threshold.line = FALSE, main = "", bg.border = "white",
bg.col = NULL, bg.lims = NULL, sort.data = TRUE, horiz = TRUE, dev.new = TRUE)
Arguments
data |
A set of data you would like to plot with bars for 1 dimension. Can be original data or factor scores or anything with at least 1 column. |
axis |
which axis (column of |
cex.names |
size of the text |
fg.col |
a matrix (single column) of colors for bars corresponding to rows of |
axis.lims |
two values in the form of |
show.bg.bars |
a set of bars to be plotted under the bars in |
threshold.line |
boolean. If TRUE, a line perpendicular to the bars is plotted. The lines appear at |
main |
A title to be placed at the top of the graph. |
bg.border |
color for |
bg.col |
a matrix (single column) of colors for background bars to be plotted under |
bg.lims |
two values in the form of |
sort.data |
a boolean. Will sort the bars by descending values. |
horiz |
see |
dev.new |
boolean. If TRUE, |
Value
bp.cols |
locations of bars (as would be returned by |
Author(s)
Derek Beaton
See Also
Examples
##stolen from ?barplot
#tN <- table(Ni <- stats::rpois(100, lambda = 5))
#the.colors <- rainbow(length(tN))
#dev.new()
#r <- barplot(tN, col = the.colors)
#prettyBars(as.matrix(tN),axis=1,fg.col=as.matrix(the.colors),horiz=FALSE,dev.new=TRUE)