outline | R Documentation |
Calculate outline of a variable-width line, possibly without simplication.
outline(x, simplify=TRUE, ...)
## S3 method for class 'vwlineGrob'
outline(x, simplify=TRUE, ...)
## S3 method for class 'offsetXsplineGrob'
outline(x, simplify=TRUE, ...)
## S3 method for class 'offsetBezierGrob'
outline(x, simplify=TRUE, ...)
x |
A variable-width line grob. |
simplify |
Whether to simplify the outline (using |
... |
Possible additional arguments for methods. |
A list with components x
and y
describing the complete outline of the variable-width line
(possibly unsimplified).
Paul Murrell
grid.vwline
,
grid.offsetXspline
grid.offsetBezier
grid.newpage()
x <- c(.2, .8, .8, .2)
y <- c(.2, .8, .2, .8)
w <- c(0, .1, .1, 0)
vwlg <- vwlineGrob(x, y, w, gp=gpar(col="grey", lwd=10, fill=NA))
grid.draw(vwlg)
o <- outline(vwlg, simplify=FALSE)
grid.polygon(o$x, o$y, default.units="in")
grid.newpage()
oxsg <- offsetXsplineGrob(x, y, w, gp=gpar(col="grey", lwd=10, fill=NA))
grid.draw(oxsg)
o <- outline(oxsg, simplify=FALSE)
grid.polygon(o$x, o$y, default.units="in")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.