prettyBars: prettyBars

Description Usage Arguments Value Author(s) See Also Examples

View source: R/prettyBars.R

Description

prettyBars creates simple, crisp, publication-style quality bar graphs.

Usage

1
2
3
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 data) should be plotted?

cex.names

size of the text

fg.col

a matrix (single column) of colors for bars corresponding to rows of data.

axis.lims

two values in the form of c(min,max) for plot limits. If NULL, the min and max are computed.

show.bg.bars

a set of bars to be plotted under the bars in data. Used for a fill effect.

threshold.line

boolean. If TRUE, a line perpendicular to the bars is plotted. The lines appear at bg.lims.

main

A title to be placed at the top of the graph.

bg.border

color for show.bg.bars borders (see border in barplot)

bg.col

a matrix (single column) of colors for background bars to be plotted under fg.col.

bg.lims

two values in the form of c(min,max) for where to plot background bars or threshold line.

sort.data

a boolean. Will sort the bars by descending values.

horiz

see horiz in barplot.

dev.new

boolean. If TRUE, dev.new is called internally to create new device. If FALSE, a device must already be open.

Value

bp.cols

locations of bars (as would be returned by barplot).

Author(s)

Derek Beaton

See Also

barplot, prettyPlot

Examples

1
2
3
4
5
6
	##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)

Example output



prettyGraphs documentation built on May 1, 2019, 9:25 p.m.