Grid-Based Bar Plots

Share:

Description

Creates a bar plot with vertical bars.

Usage

1
2
gbarplot(x, col = 1:4, legend = "NA",
         lsize = unit(0.5, "inches"), ylim = NULL)

Arguments

x

Either a vector or matrix of values describing the bars which make up the plot. If x is a vector, the plot consists of a sequence of rectangular bars with heights given by the values in the vector. If height is a matrix each bar of the plot corresponds to a column of x, with the values in the column giving the heights of stacked sub-bars making up the bar.

col

A vector of colours for the bars or bar components.

legend

A vector of characters for the bar descriptions.

lsize

An integer giving the size of the legend in inches.

ylim

Limits for the y axis.

Author(s)

Ingo Voglhuber

See Also

gmatplot, gpie, gstars, gsymbols, gbxp

Examples

1
2
3
4
5
6
7
8
 grid.newpage()

 gbarplot(c(10,20,50,40), legend=c("black item"))

 grid.newpage()

 gbarplot(cbind(c(10,30),c(40,20)), 
              legend=c("black item","red item"))