Title: | Polygon Geometry in 'grid' |
---|---|
Description: | Functions for performing polygon geometry with 'grid' grobs. This allows complex shapes to be defined by combining simpler shapes. |
Authors: | Paul Murrell [aut, cre], Jack Wong [aut] |
Maintainer: | Paul Murrell <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.4-0 |
Built: | 2024-11-21 06:45:59 UTC |
Source: | CRAN |
Given a polygonal pattern and a polygonal path, generate the Minkowski Sum by adding the pattern to the path.
minkowskiGrob(A, B, grobFn=xyListToPath, name=NULL, gp=gpar(), ...) grid.minkowski(A, B, ...)
minkowskiGrob(A, B, grobFn=xyListToPath, name=NULL, gp=gpar(), ...) grid.minkowski(A, B, ...)
A |
A grob, gList, or gTree, or a gPath or a character value identifying a grob that has already been drawn. This is known as the pattern grob. |
B |
A grob, gList, or gTree, or a gPath or a character value identifying a grob that has already been drawn. This is known as the path grob. |
grobFn |
The function that is used to create the final grob result.
Predefined options are: |
name |
A name for the resulting grob. |
gp |
Graphical parameter settings for the resulting grob. |
... |
For |
Both A
and B
should not contain self-intersections,
though they can be non-convex.
minkowskiGrob
returns a gTree.
grid.minkowski
is only used for its side-effect of drawing
on the current graphics device.
Jack Wong
xyListToPath
,
xyListToPolygon
,
xyListToLine
,
polyminkowski
pattern <- circleGrob(x = 0, y = 0, r = .1) path <- rectGrob(width = 0.5, height = 0.5) minkowski <- minkowskiGrob(pattern, path) grid.draw(minkowski)
pattern <- circleGrob(x = 0, y = 0, r = .1) path <- rectGrob(width = 0.5, height = 0.5) minkowski <- minkowskiGrob(pattern, path) grid.draw(minkowski)
These functions allow two or more grobs to be combined using one of the following operations: intersection, union, minus, and xor.
polyclipGrob(A, B, op="intersection", openFn=xyListToLine, closedFn=xyListToPath, name=NULL, gp=gpar(), ...) grid.polyclip(A, B, ...)
polyclipGrob(A, B, op="intersection", openFn=xyListToLine, closedFn=xyListToPath, name=NULL, gp=gpar(), ...) grid.polyclip(A, B, ...)
A |
A grob, gList, or gTree, or a gPath or a character value identifying a grob that has already been drawn. This is known as the subject grob. |
B |
A grob, gList, or gTree, or a gPath or a character value identifying a grob that has already been drawn. This is known as the clip grob. |
op |
A character value describing the operation. One of
|
openFn |
The function used to create grobs from the open shapes in the result. |
closedFn |
The function used to create grobs from the closed shapes in the result. |
name |
A name for the resulting grob. |
gp |
Graphical parameter settings for the resulting grob. |
... |
For |
The subject grob is combined with the clip grob using the op
operation.
The grobs are converted to coordinates by calling grid::grobCoords
and then the operation is performed by calling polyclip
.
The result is a new grob. In the case of grid.polyclip
,
this new grob will be drawn on the current device. In the special
case that A
is a gPath, by default, the new grob will
replace the old grob (the original grob identified by A
)
in the current scene
(and the new grob will use the same gp
settings as the
old grob).
The subject grob can be any combination of open or closed shapes (e.g., a combination of lines and polygons), but the clip grob must only consist of closed shapes.
polyclipGrob
returns a gTree with two children, one
representing the open shapes within the result and one representing the
closed shapes within the result.
grid.polyclip
is only used for its side-effect of drawing
on the current graphics device.
Paul Murrell
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4) c <- circleGrob(x=2/3, y=2/3, r=.2) grid.draw(r) grid.draw(c) grid.polyclip(r, c, gp=gpar(fill="grey"))
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4) c <- circleGrob(x=2/3, y=2/3, r=.2) grid.draw(r) grid.draw(c) grid.polyclip(r, c, gp=gpar(fill="grey"))
Given a polygonal lines or open grob, Generate the offset region (guard region, buffer region, morphological dilation) formed by shifting the boundary outwards by a specific distance.
polylineoffsetGrob(A, delta, rule = "winding", name=NULL, gp=gpar(), ...) grid.polylineoffset(A, delta, ...)
polylineoffsetGrob(A, delta, rule = "winding", name=NULL, gp=gpar(), ...) grid.polylineoffset(A, delta, ...)
A |
A grob, gList, or gTree, or a gPath or a character value identifying a grob that has already been drawn. This is known as the subject grob. |
delta |
Distance over which the boundary should be shifted. |
rule |
A character value describing the fill rule to be used. One of |
name |
A name for the resulting grob. |
gp |
Graphical parameter settings for the resulting grob. |
... |
For |
The grobs are converted to coordinates by calling grid::xyListFromGrob
.
The result is a new grob. In the case of grid.polylineoffset
,
this new grob will be drawn on the current device. In the special
case that A
is a gPath, by default, the new grob will
replace the old grob (the original grob identified by A
)
in the current scene
(and the new grob will use the same gp
settings as the
old grob).
The argument jointype
determines what happens at the vertices of each line at polyclip::polylineoffset
. See code link polylineoffset
.
The argument endtype
determines what happens at the beginning and end of each line at polyclip::polylineoffset
. See code link polylineoffset
.
The argument rule
is a character value describing the fill rule to be used. One of "winding"
, "evenodd"
polylineoffsetGrob
returns a gTree with offset grob coordinate.
grid.polylineoffset
is only used for its side-effect of drawing
on the current graphics device.
Jack Wong
grobLine = linesGrob(x = c(.4, .8, .8, .2, .6), y = c(.3, .3, .8, .8, .6), name = "Line 1") grid.polylineoffset(grobLine, delta = unit(0.1, "cm"), jointype="square", endtype = "opensquare")
grobLine = linesGrob(x = c(.4, .8, .8, .2, .6), y = c(.3, .3, .8, .8, .6), name = "Line 1") grid.polylineoffset(grobLine, delta = unit(0.1, "cm"), jointype="square", endtype = "opensquare")
Given a polygonal region or closed grob, generate the offset region (guard region, buffer region, morphological dilation) formed by shifting the boundary outwards by a specific distance.
polyoffsetGrob(A, delta, reduce = "union", rule = "winding", name=NULL, gp=gpar(), ...) grid.polyoffset(A, delta, ...)
polyoffsetGrob(A, delta, reduce = "union", rule = "winding", name=NULL, gp=gpar(), ...) grid.polyoffset(A, delta, ...)
A |
A grob, gList, or gTree, or a gPath or a character value identifying a grob that has already been drawn. This is known as the subject grob. |
delta |
Distance over which the boundary should be shifted. |
rule |
A character value describing the fill rule to be used. One of |
reduce |
A character value describing the operation to be used if
|
name |
A name for the resulting grob. |
gp |
Graphical parameter settings for the resulting grob. |
... |
For |
The grobs are converted to coordinates by calling grid::xyListFromGrob
.
The result is a new grob. In the case of grid.polyoffset
,
this new grob will be drawn on the current device. In the special
case that A
is a gPath, by default, the new grob will
replace the old grob (the original grob identified by A
)
in the current scene
(and the new grob will use the same gp
settings as the
old grob).
Examples of useful arguments that will be passed on to polyclip::polyoffset() are jointype
.
The argument jointype
determines what happens at the vertices of each line at polyclip::polyoffset
. See code link polyoffset
.
The argument rule
is a character value describing the fill rule to be used. One of "winding"
, "evenodd"
polyoffsetGrob
returns a gTree with offset grob coordinate.
grid.polyoffset
is only used for its side-effect of drawing
on the current graphics device.
Jack Wong
grob <- rectGrob(width = 0.5, height = 0.5) offset <- polyoffsetGrob(grob, 0.2) grid.draw(offset)
grob <- rectGrob(width = 0.5, height = 0.5) offset <- polyoffsetGrob(grob, 0.2) grid.draw(offset)
This function takes a grob (or gTree) that draws multiple shapes and reduces it to a grob that only draws one shape.
More accurately, the result only draws at most one closed shape and at most one open shape.
reduceGrob(x, op=if (isClosedShape(x)) "union" else "flatten", openFn=xyListToLine, closedFn=xyListToPath, name=NULL, gp=gpar()) grid.reduce(x, ...)
reduceGrob(x, op=if (isClosedShape(x)) "union" else "flatten", openFn=xyListToLine, closedFn=xyListToPath, name=NULL, gp=gpar()) grid.reduce(x, ...)
x |
A grob, gList, or gTree, or a gPath or a character value identifying a grob that has already been drawn. |
op |
A character value describing the operation. One of
|
openFn |
The function used to create grobs from the open shapes in the result. |
closedFn |
The function used to create grobs from the closed shapes in the result. |
name |
A name for the resulting grob. |
gp |
Graphical parameter settings for the resulting grob. |
... |
For |
Multiple shapes are combined using polyclip()
and the
specified operator op
.
reduceGrob
returns a gTree with two children, one
representing the open shapes within the result and one representing the
closed shapes within the result.
grid.reduce
is only used for its side-effect of drawing
on the current graphics device.
Paul Murrell
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4) c <- circleGrob(x=2/3, y=2/3, r=.3) grid.reduce(grobTree(r, c), gp=gpar(fill="grey"))
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4) c <- circleGrob(x=2/3, y=2/3, r=.3) grid.reduce(grobTree(r, c), gp=gpar(fill="grey"))
These functions generate one or more lines by subsetting a line.
trimGrob(x, from, to, rep=FALSE, name=NULL, gp=gpar(), ...) grid.trim(x, ...)
trimGrob(x, from, to, rep=FALSE, name=NULL, gp=gpar(), ...) grid.trim(x, ...)
x |
A grob, or a gPath (or a character value) identifying a grob that has already been drawn. |
from |
A numeric vector or a unit object describing the start point of each subset. |
to |
A numeric vector or a unit object describing the end point of each subset. |
rep |
A logical value indicating whether the |
name |
A name for the resulting grob. |
gp |
Graphical parameter settings for the resulting grob. |
... |
For |
Both from
and to
should be either numeric values
between 0 and 1, expressing a proportion of the line length,
or unit objects. In the latter case, the unit
is converted to a proportion of the line length, with "npc"
units treated as proportions of the line length.
Both from
and to
can be vectors (and they
are recycled) so that multiple subsets can be obtained in
a single call.
Both from
and to
can be negative, in which case the value is treated as distance
backwards along the line from its end.
The result is a new grob. In the case of grid.trim
,
this new grob will be drawn on the current device. In the special
case that x
is a gPath, by default, the new grob will
replace the old grob (the original grob identified by x
)
in the current scene
(and the new grob will use the same gp
settings as the
old grob).
trimGrob
returns a polyline grob.
grid.trim
is only used for its side-effect of drawing
on the current graphics device.
Paul Murrell
g <- xsplineGrob(c(.2, .5, .8), c(.2, .8, .2)) grid.draw(g) grid.trim(g, from=.1, to=.2, gp=gpar(lwd=5)) grid.trim(g, from=.1, to=.2, rep=TRUE, gp=gpar(lwd=3))
g <- xsplineGrob(c(.2, .5, .8), c(.2, .8, .2)) grid.draw(g) grid.trim(g, from=.1, to=.2, gp=gpar(lwd=5)) grid.trim(g, from=.1, to=.2, rep=TRUE, gp=gpar(lwd=3))
This function combines two sets of coordinates using one of the following operations: intersection, union, minus, and xor.
polyclip(A, B, ...) ## S3 method for class 'grob' polyclip(A, B, op="intersection", closed=isClosedShape(A), reduceA = if (closed) "union" else "flatten", reduceB = "union", fillA = NULL, fillB = NULL, ...) ## S3 method for class 'gList' polyclip(A, B, op="intersection", closed=isClosedShape(A), reduceA = if (closed) "union" else "flatten", reduceB = "union", fillA = NULL, fillB = NULL, ...) ## S3 method for class 'gPath' polyclip(A, B, op="intersection", closed, strict=FALSE, grep=FALSE, global=FALSE, reduceA = if (closed) "union" else "flatten", reduceB = "union", fillA = NULL, fillB = NULL, ...) ## S3 method for class 'character' polyclip(A, B, op="intersection", closed, strict=FALSE, grep=FALSE, global=FALSE, reduceA = if (closed) "union" else "flatten", reduceB = "union", fillA = NULL, fillB = NULL, ...)
polyclip(A, B, ...) ## S3 method for class 'grob' polyclip(A, B, op="intersection", closed=isClosedShape(A), reduceA = if (closed) "union" else "flatten", reduceB = "union", fillA = NULL, fillB = NULL, ...) ## S3 method for class 'gList' polyclip(A, B, op="intersection", closed=isClosedShape(A), reduceA = if (closed) "union" else "flatten", reduceB = "union", fillA = NULL, fillB = NULL, ...) ## S3 method for class 'gPath' polyclip(A, B, op="intersection", closed, strict=FALSE, grep=FALSE, global=FALSE, reduceA = if (closed) "union" else "flatten", reduceB = "union", fillA = NULL, fillB = NULL, ...) ## S3 method for class 'character' polyclip(A, B, op="intersection", closed, strict=FALSE, grep=FALSE, global=FALSE, reduceA = if (closed) "union" else "flatten", reduceB = "union", fillA = NULL, fillB = NULL, ...)
A |
A set of coordinates describing the subject shape. Or a grob, gList, or a gPath (or a character value) identifying a grob that has already been drawn from which coordinates are generated. |
B |
A set of coordinates describing the clip shape. Or a grob, gList, or a gPath (or a character value) identifying a grob that has already been drawn from which coordinates are generated. |
op |
A character value describing the operation. One of
|
closed |
A logical value indicating whether the |
reduceA , reduceB
|
A character value describing the operation to be used if either
|
fillA , fillB
|
A character value describing the fill rule. Possible values are
|
strict , grep , global
|
Arguments controlling the interpretation of the gPath
(passed to |
... |
Arguments used by methods. |
The subject coordinates are combined with the clip coordinates
using the op
operation.
The result is a new set of coordinates.
Paul Murrell
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4) c <- circleGrob(x=2/3, y=2/3, r=.2) polyclip(r, c)
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4) c <- circleGrob(x=2/3, y=2/3, r=.2) polyclip(r, c)
Given a list of polygonal lines or open grob object, generate the offset region (guard region, buffer region, morphological dilation) formed by shifting the boundary outwards by a specific distance.
polylineoffset(A, delta, ...) ## S3 method for class 'grob' polylineoffset(A, delta, ...) ## S3 method for class 'gList' polylineoffset(A, delta, ...) ## S3 method for class 'gPath' polylineoffset(A, delta, ..., strict=FALSE, grep=FALSE, global=FALSE) ## S3 method for class 'character' polylineoffset(A, delta, ..., strict=FALSE, grep=FALSE, global=FALSE) ## S3 method for class 'list' polylineoffset(A, delta, ...)
polylineoffset(A, delta, ...) ## S3 method for class 'grob' polylineoffset(A, delta, ...) ## S3 method for class 'gList' polylineoffset(A, delta, ...) ## S3 method for class 'gPath' polylineoffset(A, delta, ..., strict=FALSE, grep=FALSE, global=FALSE) ## S3 method for class 'character' polylineoffset(A, delta, ..., strict=FALSE, grep=FALSE, global=FALSE) ## S3 method for class 'list' polylineoffset(A, delta, ...)
A |
A set of coordinates describing the subject shape. Or a grob, gList, or a gPath (or a character value) identifying a grob that has already been drawn from which coordinates are generated. |
delta |
Distance over which the boundary should be shifted. |
strict , grep , global
|
Arguments controlling the interpretation of the gPath
(passed to |
... |
For |
Calculate the offset region by using the subject coordinates shift by a delta distance.
The argument jointype
determines what happens at the vertices of each line.
jointype = "round"
: a circular arc is generated.
jointype = "square"
: circular arc is replaced by a single straight line.
jointype = "miter"
: circular arc is omitted entirely and replaced by a single straight line.
The argument endtype
determines what happens at the beginning and end of each line.
endtype = "closedpolygon"
: ends are joined together (using the jointype value
) and the path filled as a polygon.
endtype = "closedline"
: nds are joined together (using the jointype value
) and the path filled as a polyline.
endtype = "openbutt"
: ends are squared off abruptly.
endtype = "opensquare"
: ends are squared off at distance delta
.
endtype = "openround"
: ends are replaced by a semicircular arc.
The result is a new set of coordinates for the outline of the offset region.
Jack Wong
grobLine = linesGrob(x = c(.4, .8, .8, .2, .6), y = c(.3, .3, .8, .8, .6), name = "Line 1") offset <- polylineoffset(grobLine, delta = unit(0.1, "cm"), jointype="square", endtype = "opensquare")
grobLine = linesGrob(x = c(.4, .8, .8, .2, .6), y = c(.3, .3, .8, .8, .6), name = "Line 1") offset <- polylineoffset(grobLine, delta = unit(0.1, "cm"), jointype="square", endtype = "opensquare")
This function generates the Minkowski Sum of two sets of coordinates.
polyminkowski(A, B, ...) ## S3 method for class 'grob' polyminkowski(A, B, closed=isClosedShape(B), reduceA = "union", reduceB = "union", ...) ## S3 method for class 'gList' polyminkowski(A, B, closed=isClosedShape(B), reduceA = "union", reduceB = "union", ...) ## S3 method for class 'gPath' polyminkowski(A, B, closed, strict=FALSE, grep=FALSE, global=FALSE, reduceA = "union", reduceB = "union", ...) ## S3 method for class 'character' polyminkowski(A, B, closed, strict=FALSE, grep=FALSE, global=FALSE, reduceA = "union", reduceB = "union", ...)
polyminkowski(A, B, ...) ## S3 method for class 'grob' polyminkowski(A, B, closed=isClosedShape(B), reduceA = "union", reduceB = "union", ...) ## S3 method for class 'gList' polyminkowski(A, B, closed=isClosedShape(B), reduceA = "union", reduceB = "union", ...) ## S3 method for class 'gPath' polyminkowski(A, B, closed, strict=FALSE, grep=FALSE, global=FALSE, reduceA = "union", reduceB = "union", ...) ## S3 method for class 'character' polyminkowski(A, B, closed, strict=FALSE, grep=FALSE, global=FALSE, reduceA = "union", reduceB = "union", ...)
A |
A set of coordinates describing a pattern shape. Or a grob, gList, or a gPath (or a character value) identifying a grob that has already been drawn from which coordinates are generated. |
B |
A set of coordinates describing a path shape. Or a grob, gList, or a gPath (or a character value) identifying a grob that has already been drawn from which coordinates are generated. |
closed |
A logical value indicating whether the |
reduceA , reduceB
|
A character value describing the operation to be used if either
|
strict , grep , global
|
Arguments controlling the interpretation of the gPath
(passed to |
... |
Arguments used by methods. |
The shape described by the pattern coordinates is added to the shape described by the path coordinates.
The result is a new set of coordinates.
Paul Murrell
c <- circleGrob(x=0, y=0, r=.1) r <- rectGrob(width=.5, height=.5) polyminkowski(c, r)
c <- circleGrob(x=0, y=0, r=.1) r <- rectGrob(width=.5, height=.5) polyminkowski(c, r)
Given a polygonal region or closed grob, generate the offset region (guard region, buffer region, morphological dilation) formed by shifting the boundary outwards by a specific distance.
polyoffset(A, delta, reduce = "union", ...) ## S3 method for class 'grob' polyoffset(A, delta, reduce = "union", ...) ## S3 method for class 'gList' polyoffset(A, delta, reduce = "union", ...) ## S3 method for class 'gPath' polyoffset(A, delta, reduce = "union", ..., strict=FALSE, grep=FALSE, global=FALSE) ## S3 method for class 'character' polyoffset(A, delta, reduce = "union", ..., strict=FALSE, grep=FALSE, global=FALSE) ## S3 method for class 'list' polyoffset(A, delta, reduce = "union", ...)
polyoffset(A, delta, reduce = "union", ...) ## S3 method for class 'grob' polyoffset(A, delta, reduce = "union", ...) ## S3 method for class 'gList' polyoffset(A, delta, reduce = "union", ...) ## S3 method for class 'gPath' polyoffset(A, delta, reduce = "union", ..., strict=FALSE, grep=FALSE, global=FALSE) ## S3 method for class 'character' polyoffset(A, delta, reduce = "union", ..., strict=FALSE, grep=FALSE, global=FALSE) ## S3 method for class 'list' polyoffset(A, delta, reduce = "union", ...)
A |
A set of coordinates describing the subject shape. Or a grob, gList, or a gPath (or a character value) identifying a grob that has already been drawn from which coordinates are generated. |
delta |
Distance over which the boundary should be shifted. |
reduce |
A character value describing the operation to be used if
|
strict , grep , global
|
Arguments controlling the interpretation of the gPath
(passed to |
... |
For |
Calculate the offset region by using the subject coordinates shift by a delta distance.
Examples of useful arguments that will be passed on to polyclip::polyoffset() are jointype
.
The argument jointype
determines what happens at the vertices of each line.
jointype = "round"
: a circular arc is generated.
jointype = "square"
: circular arc is replaced by a single straight line.
jointype = "miter"
: circular arc is omitted entirely and replaced by a single straight line.
The result is a new set of coordinates for the outline of the offset region.
Jack Wong
grob <- rectGrob(width = 0.5, height = 0.5) offset <- polyoffset(grob, 0.2)
grob <- rectGrob(width = 0.5, height = 0.5) offset <- polyoffset(grob, 0.2)
This functions generates a new set of coordinates by subsetting a set of coordinates.
trim(x, from, to, ...) ## S3 method for class 'grob' trim(x, from, to, rep=FALSE, ...) ## S3 method for class 'gPath' trim(x, from, to, rep=FALSE, strict=FALSE, grep=FALSE, global=FALSE, ...) ## S3 method for class 'character' trim(x, from, to, rep=FALSE, strict=FALSE, grep=FALSE, global=FALSE, ...)
trim(x, from, to, ...) ## S3 method for class 'grob' trim(x, from, to, rep=FALSE, ...) ## S3 method for class 'gPath' trim(x, from, to, rep=FALSE, strict=FALSE, grep=FALSE, global=FALSE, ...) ## S3 method for class 'character' trim(x, from, to, rep=FALSE, strict=FALSE, grep=FALSE, global=FALSE, ...)
x |
A set of coordinates. Or a grob, or a gPath (or a character value) identifying a grob that has already been drawn from which coordinates are generated. |
from |
A numeric vector or a unit object describing the start point of each subset. |
to |
A numeric vector or a unit object describing the end point of each subset. |
rep |
A logical value indicating whether the |
strict , grep , global
|
Arguments controlling the interpretation of the gPath
(passed to |
... |
Arguments used by methods. |
A new set of coordinates.
Paul Murrell
g <- segmentsGrob(0, .5, 1, .5) trim(g, from=.1, to=.2) trim(g, from=.1, to=.2, rep=TRUE)
g <- segmentsGrob(0, .5, 1, .5) trim(g, from=.1, to=.2) trim(g, from=.1, to=.2, rep=TRUE)
This function generates a set of coordinates (a list of (x,y) lists) from a grob.
xyListFromGrob(x, op = if (closed) "union" else "flatten", closed = isClosedShape(x), ...)
xyListFromGrob(x, op = if (closed) "union" else "flatten", closed = isClosedShape(x), ...)
x |
A grob. |
op |
A character value describing the operation to be used if
Can also be |
closed |
A logical value indicating whether we coordinates describing a closed shape or an open shape from. |
... |
Arguments passed on to |
The result is a list of lists, each with components x
and y
.
Paul Murrell
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4) xyListFromGrob(r)
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4) xyListFromGrob(r)
This function generates a grob from a set of coordinates (a list of (x,y) lists).
xyListToPath(x, rule=, name=NULL, gp=gpar()) xyListToPolygon(x, name=NULL, gp=gpar()) xyListToLine(x, name=NULL, gp=gpar()) xyListPath(x, rule, name=NULL, gp=gpar()) xyListPolygon(x, name=NULL, gp=gpar()) xyListLine(x, name=NULL, gp=gpar())
xyListToPath(x, rule=, name=NULL, gp=gpar()) xyListToPolygon(x, name=NULL, gp=gpar()) xyListToLine(x, name=NULL, gp=gpar()) xyListPath(x, rule, name=NULL, gp=gpar()) xyListPolygon(x, name=NULL, gp=gpar()) xyListLine(x, name=NULL, gp=gpar())
x |
A set of coordinates (e.g., from |
rule |
A fill rule: |
name |
A name for the resulting grob. |
gp |
Graphical parameter settings for the resulting grob. |
Following the addition of the xyListFromGrob
function,
the *To*()
forms are preferred.
The result is a grob.
Paul Murrell
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4) c <- circleGrob(x=2/3, y=2/3, r=.2) coords <- polyclip(r, c) xyListPath(coords) xyListLine(coords)
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4) c <- circleGrob(x=2/3, y=2/3, r=.2) coords <- polyclip(r, c) xyListPath(coords) xyListLine(coords)