Draw a Bezier curve or Bezier spline (multiple Bezier curves strung together).
grid.Bezier(...)
BezierGrob(x, y, default.units="npc",
open=TRUE, stepFn=nSteps(100), gp=gpar(), name=NULL)
Locations of control points. There should be four,
or seven (or six if not open
), or ten (or nine), etc.
Locations can be numeric or grid "unit"
objects.
The coordinate system to use if control point locations are just numeric.
Whether to reuse the first control point as the last control point. If closed, the shape may also be filled.
A function to generate values of t at which the
curve will be evaluated for drawing. The default is 100 equal-sized
steps from 0 to 1. This function is called for each Bezier curve
within
the Bezier spline, with arguments x
,
y
(the control points), and range
(indicating the
range of t to generate values for).
A grid "gpar"
object, as produced by
gpar()
, or NULL
.
A name for the grob that is generated.
Arguments passed from grid.Bezier()
to
BezierGrob()
.
BezierGrob
produces a "BezierGrob"
object.
This function will produce a nicer result than the
grid.bezier
function from grid
(because the latter is just an approximation using X-splines).
This function also supports Bezier splines.
# NOT RUN {
grid.Bezier(c(.2, .2, .8, .8), c(.2, .8, .8, .2))
# }
Run the code above in your browser using DataCamp Workspace