grid.vwcurve | R Documentation |
Draw a variable-width line where the main line is a series of straight line segments that are assumed to be a flattened approximation to a smooth curve and the width is specified at each vertex along the flattened curve.
vwcurveGrob(x, y, w, default.units="npc", open=TRUE, angle="perp",
lineend="butt", mitrelimit=4,
render=if (open) vwPolygon else vwPath(),
gp=gpar(fill="black"), name=NULL, debug=FALSE)
grid.vwcurve(...)
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 |
open |
A boolean indicating whether to connect the last location back to the first location to produce a closed line. |
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 |
The widths are calculated perpendicular to the average angle at each
vertex (or just perpendicular to the line segment for the first and
last vertex), unless a numeric angle
is specified, in
which case the widths are calculated at that angle at every vertex.
grid.vwcurve
is used for its side-effect of drawing a
variable-width
line; vwcurveGrob
returns a "vwcurveGrob"
object.
Paul Murrell
grid.vwline
,
grid.vwXspline
,
grid.brushXspline
,
grid.offsetXspline
grid.newpage()
x <- seq(.2, .8, length.out=100)
y <- .05*sin(seq(0, 2*pi, length.out=100))
w <- unit(seq(2, 10, length.out=100), "mm")
grid.vwcurve(x, y + .8, w)
grid.vwcurve(x, y + .6, w,
angle=45)
grid.vwcurve(x, y + .4, w,
lineend="round")
grid.vwcurve(x, y + .2, w,
gp=gpar(col="black"), debug=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.