grid.vwXspline {vwline} | R Documentation |
Draw a variable-width X-spline.
Description
Draw a variable-width X-spline where the main line is described by x/y control points and the width describes offset control points.
Usage
vwXsplineGrob(x, y, w, default.units="npc", shape=1,
open=TRUE, repEnds=TRUE, angle="perp",
lineend="butt", mitrelimit=4,
render=vwPath(),
gp=gpar(fill="black"), name=NULL, debug=FALSE)
grid.vwXspline(...)
Arguments
x |
A numeric vector or unit describing x-locations. |
y |
A numeric vector or unit describing y-locations. |
w |
A numeric vector or unit describing widths at each location,
or a width specification generated by |
default.units |
The units used if |
shape |
A numeric value (or one per location) that controls the shape of the X-spline curve relative to the locations. |
open |
A boolean indicating whether to connect the last location back to the first location to produce a closed line. |
repEnds |
A logical indicating whether to replicate the
first and last control points (so that the X-spline starts and
ends at the first and last control points). Can also be the
special value |
angle |
Either |
lineend |
The line ending style; one of |
mitrelimit |
A numeric that controls when a mitre join is converted to a bevel join or a mitre ending is converted to a square ending. |
render |
A function that is used to render the outline of the path that is generated for the variable-width line. |
gp |
A set of graphical parameters; see |
name |
A name for the grob generated for the variable-width line. |
debug |
A logical indicating whether to produce graphical debugging output. |
... |
Arguments passed to |
Details
See grid.xspline
for more about the behaviour of X-splines.
Value
grid.vwXspline
is used for its side-effect of drawing a
variable-width
line; vwXsplineGrob
returns a "vwXsplineGrob"
object.
Author(s)
Paul Murrell
See Also
grid.xspline
,
grid.vwline
,
grid.vwXspline
,
grid.brushXspline
,
grid.offsetXspline
Examples
grid.newpage()
x <- c(.2, .4, .6, .8)
y <- c(-.05, .05, -.05, .05)
w <- unit(c(2, 4, 6, 8), "mm")
grid.vwXspline(x, y + .8, w)
grid.vwXspline(x, y + .6, w,
angle=45)
grid.vwXspline(x, y + .4, w,
lineend="round")
grid.vwXspline(x, y + .2, w,
gp=gpar(col="black"), debug=TRUE)