EVOLUTION-MANAGER
Edit File: lines.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: Add Connected Line Segments to a Plot</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 lines {graphics}"><tr><td>lines {graphics}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Add Connected Line Segments to a Plot</h2> <h3>Description</h3> <p>A generic function taking coordinates given in various ways and joining the corresponding points with line segments. </p> <h3>Usage</h3> <pre> lines(x, ...) ## Default S3 method: lines(x, y = NULL, type = "l", ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x, y</code></td> <td> <p>coordinate vectors of points to join.</p> </td></tr> <tr valign="top"><td><code>type</code></td> <td> <p>character indicating the type of plotting; actually any of the <code>type</code>s as in <code><a href="plot.default.html">plot.default</a></code>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Further graphical parameters (see <code><a href="par.html">par</a></code>) may also be supplied as arguments, particularly, line type, <code>lty</code>, line width, <code>lwd</code>, color, <code>col</code> and for <code>type = "b"</code>, <code>pch</code>. Also the line characteristics <code>lend</code>, <code>ljoin</code> and <code>lmitre</code>.</p> </td></tr> </table> <h3>Details</h3> <p>The coordinates can be passed in a plotting structure (a list with <code>x</code> and <code>y</code> components), a two-column matrix, a time series, .... See <code><a href="../../grDevices/html/xy.coords.html">xy.coords</a></code>. If supplied separately, they must be of the same length. </p> <p>The coordinates can contain <code>NA</code> values. If a point contains <code>NA</code> in either its <code>x</code> or <code>y</code> value, it is omitted from the plot, and lines are not drawn to or from such points. Thus missing values can be used to achieve breaks in lines. </p> <p>For <code>type = "h"</code>, <code>col</code> can be a vector and will be recycled as needed. </p> <p><code>lwd</code> can be a vector: its first element will apply to lines but the whole vector to symbols (recycled as necessary). </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="plot.formula.html">lines.formula</a></code> for the formula method; <code><a href="points.html">points</a></code>, particularly for <code>type %in% c("p","b","o")</code>, <code><a href="plot.html">plot</a></code>, and the workhorse function <code><a href="plot.xy.html">plot.xy</a></code>. </p> <p><code><a href="abline.html">abline</a></code> for drawing (single) straight lines. </p> <p><code><a href="par.html">par</a></code> for line type (<code>lty</code>) specification and how to specify colors. </p> <h3>Examples</h3> <pre> # draw a smooth line through a scatter plot plot(cars, main = "Stopping Distance versus Speed") lines(stats::lowess(cars)) </pre> <hr /><div style="text-align: center;">[Package <em>graphics</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>