EVOLUTION-MANAGER
Edit File: plot.ts.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Plotting Time-Series Objects</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for plot.ts {stats}"><tr><td>plot.ts {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Plotting Time-Series Objects</h2> <h3>Description</h3> <p>Plotting method for objects inheriting from class <code>"ts"</code>. </p> <h3>Usage</h3> <pre> ## S3 method for class 'ts' plot(x, y = NULL, plot.type = c("multiple", "single"), xy.labels, xy.lines, panel = lines, nc, yax.flip = FALSE, mar.multi = c(0, 5.1, 0, if(yax.flip) 5.1 else 2.1), oma.multi = c(6, 0, 5, 0), axes = TRUE, ...) ## S3 method for class 'ts' lines(x, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x, y</code></td> <td> <p>time series objects, usually inheriting from class <code>"ts"</code>.</p> </td></tr> <tr valign="top"><td><code>plot.type</code></td> <td> <p>for multivariate time series, should the series by plotted separately (with a common time axis) or on a single plot? Can be abbreviated.</p> </td></tr> <tr valign="top"><td><code>xy.labels</code></td> <td> <p>logical, indicating if <code><a href="../../graphics/html/text.html">text</a>()</code> labels should be used for an x-y plot, <em>or</em> character, supplying a vector of labels to be used. The default is to label for up to 150 points, and not for more.</p> </td></tr> <tr valign="top"><td><code>xy.lines</code></td> <td> <p>logical, indicating if <code><a href="../../graphics/html/lines.html">lines</a></code> should be drawn for an x-y plot. Defaults to the value of <code>xy.labels</code> if that is logical, otherwise to <code>TRUE</code>.</p> </td></tr> <tr valign="top"><td><code>panel</code></td> <td> <p>a <code>function(x, col, bg, pch, type, ...)</code> which gives the action to be carried out in each panel of the display for <code>plot.type = "multiple"</code>. The default is <code>lines</code>.</p> </td></tr> <tr valign="top"><td><code>nc</code></td> <td> <p>the number of columns to use when <code>type = "multiple"</code>. Defaults to 1 for up to 4 series, otherwise to 2.</p> </td></tr> <tr valign="top"><td><code>yax.flip</code></td> <td> <p>logical indicating if the y-axis (ticks and numbering) should flip from side 2 (left) to 4 (right) from series to series when <code>type = "multiple"</code>.</p> </td></tr> <tr valign="top"><td><code>mar.multi, oma.multi</code></td> <td> <p>the (default) <code><a href="../../graphics/html/par.html">par</a></code> settings for <code>plot.type = "multiple"</code>. Modify with care!</p> </td></tr> <tr valign="top"><td><code>axes</code></td> <td> <p>logical indicating if x- and y- axes should be drawn.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>additional graphical arguments, see <code><a href="../../graphics/html/plot.html">plot</a></code>, <code><a href="../../graphics/html/plot.default.html">plot.default</a></code> and <code><a href="../../graphics/html/par.html">par</a></code>.</p> </td></tr> </table> <h3>Details</h3> <p>If <code>y</code> is missing, this function creates a time series plot, for multivariate series of one of two kinds depending on <code>plot.type</code>. </p> <p>If <code>y</code> is present, both <code>x</code> and <code>y</code> must be univariate, and a scatter plot <code>y ~ x</code> will be drawn, enhanced by using <code><a href="../../graphics/html/text.html">text</a></code> if <code>xy.labels</code> is <code><a href="../../base/html/logical.html">TRUE</a></code> or <code>character</code>, and <code><a href="../../graphics/html/lines.html">lines</a></code> if <code>xy.lines</code> is <code>TRUE</code>. </p> <h3>See Also</h3> <p><code><a href="ts.html">ts</a></code> for basic time series construction and access functionality. </p> <h3>Examples</h3> <pre> require(graphics) ## Multivariate z <- ts(matrix(rt(200 * 8, df = 3), 200, 8), start = c(1961, 1), frequency = 12) plot(z, yax.flip = TRUE) plot(z, axes = FALSE, ann = FALSE, frame.plot = TRUE, mar.multi = c(0,0,0,0), oma.multi = c(1,1,5,1)) title("plot(ts(..), axes=FALSE, ann=FALSE, frame.plot=TRUE, mar..., oma...)") z <- window(z[,1:3], end = c(1969,12)) plot(z, type = "b") # multiple plot(z, plot.type = "single", lty = 1:3, col = 4:2) ## A phase plot: plot(nhtemp, lag(nhtemp, 1), cex = .8, col = "blue", main = "Lag plot of New Haven temperatures") ## xy.lines and xy.labels are FALSE for large series: plot(lag(sunspots, 1), sunspots, pch = ".") SMI <- EuStockMarkets[, "SMI"] plot(lag(SMI, 1), SMI, pch = ".") plot(lag(SMI, 20), SMI, pch = ".", log = "xy", main = "4 weeks lagged SMI stocks -- log scale", xy.lines = TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>