grid.polylineoffset | R Documentation |
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, ...)
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
polylineoffset
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.