tsplot {astsa} | R Documentation |
Produces a nice plot of a univariate time series in one easy line.
tsplot(x, y=NULL, main=NULL, ylab=NULL, xlab='Time', type='l', margins=.25, minor=TRUE, nxm=2, nym=2, ... )
x, y |
time series to be plotted; if both present, x will be the time index. |
main |
add a plot title - the default is no title. |
ylab |
y-axis label - the default is the name of the ts object. |
xlab |
x-axis label - the default is 'Time'. |
type |
type of plot - the default is line. |
margins |
inches to add (or subtract) to the margins. |
minor, nxm, nym |
if minor=TRUE, the number of minor tick marks on x-axis, y-axis. minor=FALSE removes both or set either to 0 or 1 to remove. |
... |
other graphical parameteres; see par. |
This script is meant to be used for demonstrations so that
a nice time series plot can be produced in one quick and easy statement.
You can use it to do tricks, but you might get warnings because I had to
use 2 levels of graphics to avoid having the grid on top of the line. For
example, axes = FALSE
will work, but you will get a warning because
it applies to one level and not the other.
D.S. Stoffer
http://www.stat.pitt.edu/stoffer/tsa4/ and http://www.stat.pitt.edu/stoffer/tsda/
tsplot(soi, col=4) # tsplot(soi, main="Southern Oscillation Index") # par(mfrow=2:1) tsplot(soi, main="Title for Both") tsplot(rec) # tsplot(1:453, soi, ylab='SOI', xlab='Month')