grid.polyoffset | R Documentation |
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, ...)
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
polyoffset
grob <- rectGrob(width = 0.5, height = 0.5)
offset <- polyoffsetGrob(grob, 0.2)
grid.draw(offset)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.