stackpoly {plotrix}R Documentation

Display the columns of a matrix or data frame as stacked polygons.

Description

Plot one or more columns of numeric values as the top edges of polygons instead of lines.

Usage

 stackpoly(x,y=NULL,main="",xlab="",ylab="",xat=NA,xaxlab=NA,
  xlim=NA,ylim=NA,lty=1,border=NA,col=NA,staxx=FALSE,axis4=TRUE,...)

Arguments

x A numeric data frame or matrix with the x values. If y is NULL, these will become the y values and the x positions will be the integers from 1 to dim{x}[1].
y The y values.
main The title for the plot.
xlab,ylab x and y axis labels for the plot.
xat Where to put the optional xaxlabs.
xaxlab Optional labels for the x positions.
xlim Optional x limits.
ylim Optional y limits.
lty Line type for the polygon borders.
border Color for the polygon borders.
col Color to fill the polygons.
staxx Whether to call staxlab to stagger the x axis labels.
axis4 Whether to display the right ordinate on the plot.
... Additional arguments passed to plot.

Details

stackpoly is similar to a line plot with the area under the lines filled with color(s). Ideally, each successive set of y values is greater than the values in the previous set so that the polygons form a rising series of crests.

Value

nil

Author(s)

Jim Lemon

See Also

polygon

Examples

 testx<-matrix(cumsum(abs(rnorm(100))),nrow=10)
 stackpoly(testx,main="Test Stackpoly",
  xaxlab=c("One","Two","Three","Four","Five",
  "Six","Seven","Eight","Nine","Ten"),border="black",staxx=TRUE)

[Package plotrix version 2.4-1 Index]