grid.quad: Draw a Quadratic Bezier Spline

Description Usage Arguments Value Author(s) Examples

View source: R/quad.R

Description

Draw a quadratic Bezier curve or quadratic Bezier spline (multiple quadratic Bezier curves strung together).

Usage

1
2
3
grid.quad(...)
quadGrob(x, y, default.units="npc",
           open=TRUE, stepFn=nSteps(100), gp=gpar(), name=NULL)

Arguments

x, y

Locations of control points. There should be three, or five (or four if not open), or seven (or eight), etc. Locations can be numeric or grid "unit" objects.

default.units

The coordinate system to use if control point locations are just numeric.

open

Whether to reuse the first control point as the last control point. If closed, the shape may also be filled.

stepFn

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

gp

A grid "gpar" object, as produced by gpar(), or NULL.

name

A name for the grob that is generated.

...

Arguments passed from grid.quad() to quadGrob().

Value

quadGrob produces a "quadgrob" object.

Author(s)

Paul Murrell

Examples

1
grid.quad(c(.2, .5, .8), c(.2, .8, .2))

Example output

Loading required package: grid

gridBezier documentation built on May 22, 2019, 5:02 p.m.