Skip to content

Commit a3597ce

Browse files
committed
Add example for shape and ncp params in geom_curve()
1 parent ffdb86b commit a3597ce

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

R/geom-segment.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,23 @@ GeomSegment <- ggproto(
9494
#' arrow = arrow(length = unit(0.03, "npc"))
9595
#' )
9696
#'
97+
#' # The `shape` and `ncp` arguments of geom_curve control the sharpness of the spline
98+
#' b +
99+
#' geom_curve(
100+
#' aes(x = x1, y = y1, xend = x2, yend = y2, colour = "ncp = 5"),
101+
#' data = df,
102+
#' curvature = 1,
103+
#' shape = 0,
104+
#' ncp = 5
105+
#' ) +
106+
#' geom_curve(
107+
#' aes(x = x1, y = y1, xend = x2, yend = y2, colour = "ncp = 1"),
108+
#' data = df,
109+
#' curvature = 1,
110+
#' shape = 0,
111+
#' ncp = 1
112+
#' )
113+
#'
97114
#' if (requireNamespace('maps', quietly = TRUE)) {
98115
#' ggplot(seals, aes(long, lat)) +
99116
#' geom_segment(aes(xend = long + delta_long, yend = lat + delta_lat),

man/geom_segment.Rd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)