| Line 31... |
Line 31... |
| 31 |
locations which make up separate sub-paths.}
|
31 |
locations which make up separate sub-paths.}
|
| 32 |
\item{rule}{A character value specifying the fill rule: either
|
32 |
\item{rule}{A character value specifying the fill rule: either
|
| 33 |
\code{"winding"} or \code{"evenodd"}.}
|
33 |
\code{"winding"} or \code{"evenodd"}.}
|
| 34 |
\item{default.units}{A string indicating the default units to use
|
34 |
\item{default.units}{A string indicating the default units to use
|
| 35 |
if \code{x} or \code{y}
|
35 |
if \code{x} or \code{y}
|
| 36 |
are only given as numeric vectors.}
|
36 |
are only given as numeric vectors.}
|
| 37 |
\item{name}{ A character identifier. }
|
37 |
\item{name}{ A character identifier. }
|
| 38 |
\item{gp}{An object of class \code{gpar}, typically the output
|
38 |
\item{gp}{An object of class \code{gpar}, typically the output
|
| 39 |
from a call to the function \code{gpar}. This is basically
|
39 |
from a call to the function \code{gpar}. This is basically
|
| 40 |
a list of graphical parameter settings.}
|
40 |
a list of graphical parameter settings.}
|
| 41 |
\item{vp}{A Grid viewport object (or NULL).}
|
41 |
\item{vp}{A Grid viewport object (or NULL).}
|
| Line 50... |
Line 50... |
| 50 |
\code{draw} is \code{TRUE}).
|
50 |
\code{draw} is \code{TRUE}).
|
| 51 |
|
51 |
|
| 52 |
A path is like a polygon except that the former can contain holes, as
|
52 |
A path is like a polygon except that the former can contain holes, as
|
| 53 |
interpreted by the fill rule; these fill a region if the path border
|
53 |
interpreted by the fill rule; these fill a region if the path border
|
| 54 |
encircles it an odd or non-zero number of times, respectively.
|
54 |
encircles it an odd or non-zero number of times, respectively.
|
| 55 |
|
55 |
|
| 56 |
Not all graphics devices support this function: for example
|
56 |
Not all graphics devices support this function: for example
|
| 57 |
\code{xfig} and \code{pictex} do not.
|
57 |
\code{xfig} and \code{pictex} do not.
|
| 58 |
}
|
58 |
}
|
| 59 |
\author{Paul Murrell}
|
59 |
\author{Paul Murrell}
|
| 60 |
\seealso{
|
60 |
\seealso{
|
| Line 63... |
Line 63... |
| 63 |
}
|
63 |
}
|
| 64 |
\examples{
|
64 |
\examples{
|
| 65 |
pathSample <- function(x, y, rule, gp = gpar()) {
|
65 |
pathSample <- function(x, y, rule, gp = gpar()) {
|
| 66 |
if (is.na(rule))
|
66 |
if (is.na(rule))
|
| 67 |
grid.path(x, y, id = rep(1:2, each = 4), gp = gp)
|
67 |
grid.path(x, y, id = rep(1:2, each = 4), gp = gp)
|
| 68 |
else
|
68 |
else
|
| 69 |
grid.path(x, y, id = rep(1:2, each = 4), rule = rule, gp = gp)
|
69 |
grid.path(x, y, id = rep(1:2, each = 4), rule = rule, gp = gp)
|
| 70 |
if (!is.na(rule))
|
70 |
if (!is.na(rule))
|
| 71 |
grid.text(paste("Rule:", rule), y = 0, just = "bottom")
|
71 |
grid.text(paste("Rule:", rule), y = 0, just = "bottom")
|
| 72 |
}
|
72 |
}
|
| 73 |
|
73 |
|