Learn R Programming

mobr (version 2.0.2)

plotStacked: Stacked plot by Marc Taylor (@marchtaylor on gitHub)

Description

plotStacked makes a stacked plot where each y series is plotted on top of each other using filled polygons.

Usage

plotStacked(
  x,
  y,
  order.method = "as.is",
  ylab = "",
  xlab = "",
  border = NULL,
  lwd = 1,
  col = rainbow(length(y[1, ])),
  ylim = NULL,
  ...
)

Arguments

x

A vector of values

y

A matrix of data series (columns) corresponding to x

order.method

Method of ordering y plotting order. One of the following: c("as.is", "max", "first"). "as.is" - plot in order of y column. "max" - plot in order of when each y series reaches maximum value. "first" - plot in order of when each y series first value > 0.

ylab

y-axis labels

xlab

x-axis labels

border

Border colors for polygons corresponding to y columns (will recycle) (see ?polygon for details)

lwd

Border line width for polygons corresponding to y columns (will recycle)

col

Fill colors for polygons corresponding to y columns (will recycle).

ylim

y-axis limits. If ylim=NULL, defaults to c(0, 1.2*max(apply(y,1,sum).

...

Other plot arguments