lines {base} | R Documentation |
Add Connected Line Segments to a Plot
Description
A generic function taking coordinates given in various ways and joining the corresponding points with line segments.
Usage
lines(x, ...)
lines.default(x, y=NULL, type="l", col=par("col"), lty=par("lty"), ...)
Arguments
x , y |
coordinate vectors of points to join. |
type |
character indicating the type of plotting; actually any of
the |
col |
color to use. |
lty |
line type to use. |
... |
Further graphical parameters (see |
Details
The coordinates can be passed to lines
in a plotting structure (a list with x and y components),
a time series, etc.
See Also
points
, plot
, and the underlying “primitive”
plot.xy
.
Examples
data(cars)
# draw a smooth line through a scatter plot
plot(cars, main="Stopping Distance versus Speed")
lines(lowess(cars))