grid.bezier | R Documentation |
These functions create and draw Bezier Curves (a curve drawn relative to 4 control points).
grid.bezier(...) bezierGrob(x = c(0, 0.5, 1, 0.5), y = c(0.5, 1, 0.5, 0), id = NULL, id.lengths = NULL, default.units = "npc", arrow = NULL, name = NULL, gp = gpar(), vp = NULL)
x |
A numeric vector or unit object specifying x-locations of spline control points. |
y |
A numeric vector or unit object specifying y-locations of spline control points. |
id |
A numeric vector used to separate locations in |
id.lengths |
A numeric vector used to separate locations in |
default.units |
A string indicating the default units to use
if |
arrow |
A list describing arrow heads to place at either end
of the bezier, as produced by the |
name |
A character identifier. |
gp |
An object of class |
vp |
A Grid viewport object (or NULL). |
... |
Arguments to be passed to |
Both functions create a beziergrob (a graphical object describing a
Bezier curve), but only grid.bezier
draws the Bezier curve.
A Bezier curve is a line drawn relative to 4 control points.
Missing values are not allowed for x
and y
(i.e., it is not valid for a control point to be missing).
The curve is currently drawn using an approximation based on X-splines.
A grob object.
Grid,
viewport
,
arrow
.
grid.xspline
.
x <- c(0.2, 0.2, 0.4, 0.4) y <- c(0.2, 0.4, 0.4, 0.2) grid.newpage() grid.bezier(x, y) grid.bezier(c(x, x + .4), c(y + .4, y + .4), id=rep(1:2, each=4)) grid.segments(.4, .6, .6, .6) grid.bezier(x, y, gp=gpar(lwd=3, fill="black"), arrow=arrow(type="closed"), vp=viewport(x=.9))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.