Description Usage Arguments Aesthetics Computed variables Author(s) Examples
View source: R/bspline_closed.R
This geom creates closed b-spline curves and draws them as shapes. The
closed b-spline is achieved by wrapping the control points rather than the
knots. The *0 version uses the grid::xsplineGrob()
function with
open = FALSE
and can thus not be manipulated as a shape geom in the same
way as the base version (expand, contract, etc).
1 2 3 4 5 6 7 8 9 10 11 | stat_bspline_closed(mapping = NULL, data = NULL, geom = "shape",
position = "identity", na.rm = FALSE, n = 100, show.legend = NA,
inherit.aes = TRUE, ...)
geom_bspline_closed(mapping = NULL, data = NULL, stat = "bspline",
position = "identity", n = 100, na.rm = FALSE, show.legend = NA,
inherit.aes = TRUE, ...)
geom_bspline_closed0(mapping = NULL, data = NULL, stat = "identity",
position = "identity", na.rm = FALSE, show.legend = NA,
inherit.aes = TRUE, ...)
|
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
geom |
The geometric object to use display the data |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm |
If |
n |
The number of points generated for each spline |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
other arguments passed on to |
stat |
The statistical transformation to use on the data for this layer, as a string. |
geom_bspline understand the following aesthetics (required aesthetics are in bold):
x
y
color
fill
size
linetype
alpha
The coordinates for the path describing the spline
The progression along the interpolation mapped between 0 and 1
Thomas Lin Pedersen. The C++ code for De Boor's algorithm has been adapted from Jason Yu-Tseh Chi implementation
1 2 3 4 5 6 7 8 | controls <- data.frame(
x = runif(6),
y = runif(6)
)
ggplot(controls, aes(x, y)) +
geom_polygon(fill = NA, colour = 'grey') +
geom_point(colour = 'red') +
geom_bspline_closed(alpha = 0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.