grid.vwXspline: Draw a variable-width X-spline.

View source: R/vwxspline.R

grid.vwXsplineR 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 widthSpec.

default.units

The units used if x or y are numeric vectors.

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 "extend", in which case the first and last control segments are extended (and the resulting X-spline is a little curvier at the ends).

angle

Either "perp" or a numeric value describing a fixed orientation for the line width.

lineend

The line ending style; one of "round", "mitre", "butt", or "square".

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 gpar.

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 vwXsplineGrob.

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)

vwline documentation built on Sept. 11, 2024, 7:56 p.m.