stackPlot {ifultools} | R Documentation |
Plots input data as a stack of plots.
stackPlot(x, y = NULL, xlty = NULL, bty = "n", lty = 1, col = 1:8, lwd = 1, rescale = TRUE, add = FALSE, cex = 1, xaxs = ifelse1(is.R(), "r", "e"), xpd = TRUE, yaxis = list(add = TRUE, ndigit = 3, col = 1:8, lty = 1, lwd = 3, side = "left", cex = 1), xlab = list(text = "", cex = 1, srt = 0, col = 1), ylab = list(text = NULL, cex = 1, srt = 0, col = 1:8, side = "right"), main = list(text = "", cex = 1, srt = 0, col = 1, adj = 0.5), ylim = NULL)
x |
a vector of numeric values corresponding to a common abscissa (x-axis) for all ordinate (y-axis) values. |
y |
a numeric vector, matrix, data.frame, or rectangular list containing the ordinate (y-axis) values. |
add |
a logical value. If TRUE , the plot is added using the current
par layout. Otherwise a new plot is produced. Default: FALSE . |
bty |
a character string defining the box type (ala par 's bty parameter)
for each plot. Default: "n" (no boxes). |
cex |
a numeric value defining the character expansion for the plot labels (ala par 's cex parameter).
Default: 1. |
col |
an integer or vector of integers denoting the color of each
plotted series (ala par 's col parameter). This
input can be a vector, one color for each series plotted. If the length
of this vector is less than the number of series, then col is repeated as many
times as necessary. Default: 1:8 . |
lty |
the line type for each plot (ala par 's lty parameter). This
input can be a vector, one line type for each series plotted. If the length
of this vector is less than the number of series, then lty=1 is used for those
plots where lty is not directly specified. Default: 1. |
lwd |
an integer or vector of integers denoting the line width of each
plotted series (ala par 's lwd parameter). This
input can be a vector, one line width for each series plotted. If the length
of this vector is less than the number of series, then lwd is repeated as many
times as necessary. Default: 1. |
main |
the main label as defined by a list of the following named objects:
If a partial list of the above named objects is supplied, those objects are merged with the default list defined above. |
rescale |
a logical value. If TRUE , the data in each plot is scaled so that
visually the height of each subplot is approximately the same (the y-axis labels denote
the unscaled/original values. Default: TRUE . |
xaxs |
a character string defining the style of the x-axis
interval calculation (ala par 's xaxs parameter). Default: "e" (extended axes). |
xlab |
the x-axis label as defined by a list of the following named objects:
If a partial list of the above named objects is supplied, those objects are merged with the default list defined above. |
xlty |
the line type (ala par 's lty parameter) of
horizontal lines used to separate stacked plots. Default: NULL (no separator lines). |
xpd |
a character string defining the style of the plot clipping
(ala par 's xpd parameter). Default: TRUE . |
yaxis |
the y-axis style as defined by a list of the following named objects:
If a partial list of the above named objects is supplied, those objects are merged with the default list defined above. |
ylab |
the y-axis label(s) as defined by a list of the following named objects:
If a partial list of the above named objects is supplied, those objects are merged with the default list defined above. |
ylim |
a two-element numeric vector containing the y-axis range of each series
to plot. The range of the specified ylim values must span that of all the series,
otherwise an error is returned. Default: NULL (y-axis limits are calculated automatically). |
no output.
A stack plot is produced.
## stack-plot the sunspots series and a random ## walk series set.seed(100) ix <- seq(2048) stackPlot(x=ix, y=data.frame(sunspots[ix], cumsum(rnorm(length(ix)))), xlty=2, ylab=list(text=c("sunspots","walk")))