Description Usage Arguments Aesthetics See Also Examples
View source: R/geom-offset-bezier.R
The main curve is described by x/y position points and offset bezier curves are calculated to the left and right of the main curve at the specified widths.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | geom_offset_bezier(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
open = TRUE,
width_units = "cm",
width_fun = "bezier",
width_shape = -1,
rep = FALSE,
step_fn = nSteps(100),
linejoin = "round",
lineend = "butt",
mitre_limit = 4,
debug = FALSE,
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 |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
... |
Other arguments passed on to |
open |
a logical value indicating whether to connect the last location back to the first location to produce a closed line. |
width_units |
the units of line, detail see |
width_fun |
either "bezier" (default) or "spline" to specifying the width function:
|
width_shape |
the shape parameter for the width spline. |
rep |
a logical value indicating whether to repeat the widths along the full length of the line. |
step_fn |
function called to generate steps in t when rendering. |
linejoin |
the line join style; one of "round" (default), "mitre", or "bevel". |
lineend |
the line ending style; one of "round" (default), "mitre", "butt", or "square". |
mitre_limit |
a numeric that controls when a mitre join is converted to a bevel join or a mitre ending is converted to a square ending. |
debug |
a logical value indicating whether to produce graphical debugging output. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
geom_offset_bezier()
understands the following aesthetics (required
aesthetics are in bold):
x
y
alpha
colour
dist
fill
linetype
size
width
offsetBezierGrob
, BezierWidth
,
widthSpline
.
1 2 3 4 5 6 7 8 9 10 | df <- data.frame(
x = c(.2, .4, .6, .8),
y = c(-.05, .05, -.05, .05),
width = c(0.5, 1, 1.5, 2)
)
ggplot(df, aes(x, y, width = width)) + geom_offset_bezier()
ggplot(df, aes(x, y, width = width)) + geom_offset_bezier(lineend = "round")
ggplot(df, aes(x, y, width = width)) +
geom_offset_bezier(colour = "black", fill = NA, debug = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.