Description Usage Arguments Value Note Author(s) References Examples
Function for straightning Bezier or B-spline curves.
1 2 3 | straightenedBezier(x, y, beta = 0.5, n.evals = 100)
straightenedBSpline(x, y, order = 4, beta = 0.5, n.evals = 100)
|
x |
A numeric vector giving the x-coordinates of the control points.
Alternatively, it can be a |
y |
A numeric vector giving the y-coordinates of the control points. |
beta |
A numeric values that control amount of straightening.
A |
n.evals |
The number of evaluations of the Bezier curve. |
order |
The order of the B-spline. See |
Returns a list
of length 2 with entries x
and y
of
x and y coordinates corresponding to the evaluations of the B-spline.
The straightening is done by modifying the control points as described in the reference.
Anders Ellern Bilgrau
Holten, Danny. "Hierarchical edge bundles: Visualization of adjacency relations in hierarchical data." Visualization and Computer Graphics, IEEE Transactions on 12.5 (2006): 741-748.
1 2 3 4 5 6 7 8 9 10 11 12 | # Bezier curves
x <- list(x = cumsum(rnorm(7)),
y = cumsum(rnorm(7)))
plot(x, type = "b", col = "grey", pch = 16)
for (b in seq(0.1, 1, l = 9))
lines(Bmisc:::straightenedBezier(x, beta = b))
# B-splines
x <- cumsum(rnorm(7))
y <- cumsum(rnorm(7))
plot(x, y, type = "b", col = "grey", pch = 16)
for (b in seq(0.1, 0.9, l = 9))
lines(Bmisc:::straightenedBSpline(x, y, beta = b))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.