BarText

0th

Percentile

Add Text to a Barplot

Places some text directly on the (stacked) bars of a barplot.

Keywords
aplot
Usage
BarText(height, b, labels = height, beside = FALSE, horiz = FALSE, ...)
Arguments
height
either a vector or matrix of values describing the bars which make up the plot exactly as used for creating the barplot.

b
the returned mid points as returned by b <- barplot(...).

labels
the labels to be placed on the bars.

beside
a logical value. If FALSE, the columns of height are portrayed as stacked bars, and if TRUE the columns are portrayed as juxtaposed bars.

horiz
a logical value. If FALSE, the bars are drawn vertically with the first bar to the left. If TRUE, the bars are drawn horizontally with the first at the bottom.

...
the dots are passed to the text.

Details

It sometimes makes sense to place the results directly on the bars.

See Also

help

Aliases
  • BarText
Examples
b <- barplot(VADeaths)
BarText(VADeaths, b=b)

b <- barplot(VADeaths, horiz = TRUE)
BarText(VADeaths, b=b, horiz = TRUE, col="red", cex=1.5)
Documentation reproduced from package DescTools, version 0.99.19, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.