% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nr-draw.R
\name{nr_polyline}
\alias{nr_polyline}
\title{Draw a polyline on a native raster image}
\usage{
nr_polyline(
  nr,
  x,
  y,
  color = "black",
  linewidth = 1,
  mitre_limit = linewidth,
  close = FALSE,
  use_alpha = TRUE
)
}
\arguments{
\item{nr}{native raster image}

\item{x, y}{Vectors of point coordinates}

\item{color}{Color as a character string. Either a standard R color
(e.g. 'blue', 'white')
or a hex color of the form \code{#rrggbbaa}, \code{#rrggbb}, \code{#rgba}
or \code{#rgb}}

\item{linewidth}{Line linewidth. Default: 1.  If \code{linewidth = 1} then a 
naive version of Bresenham is used to draw the points.  If linewidth 
is greater than 1, then the line is convert to a triangle strip and
rendered as polygons.}

\item{mitre_limit}{Limit the size of the mitre when two lines meet at an 
acute angle and linewidth is greater than 1. Default: same as line 
linewidth which mostly looks OK.}

\item{close}{Should the polyline be closed? I.e. should a line be drawn between
the last point and the first point?   Default: FALSE}

\item{use_alpha}{Use alpha channel when drawing? Logical. Default: TRUE}
}
\value{
Invisibly return the supplied native raster image which was been
        modified in-place
}
\description{
Draw a polyline on a native raster image
}
\examples{
w <- 200
h <- 150
nr <- nr_new(w, h, 'grey80')

N  <- 20
theta <- seq(0, 2 * pi, length.out = N)
xs <- w/2 + 50 * cos(theta)
ys <- h/2 + 50 * sin(theta)

nr_polyline(nr, xs, ys)
nr_point(nr, xs, ys, col = 'red')
plot(nr)
}
\seealso{
Other drawing functions: 
\code{\link{nr_circle}()},
\code{\link{nr_polygon}()},
\code{\link{nr_rect}()},
\code{\link{nr_tri_mesh}()}
}
\concept{drawing functions}
