Currently, the stat_link* family plots paths, but it would be great to have a version that works like GeomLine (i.e., drawn by along the x-value), or at least support for mixing with GeomLine:
ggplot(lines, aes(x = x, y = y, colour = colour, size = width, group = 1)) +
layer(stat = StatLink2, geom = ggforce:::GeomPathInterpolate,
position = position_identity(),
params = list(n = 500, lineend = 'round'))
#> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
#> ℹ Please use `linewidth` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
doesn’t work with GeomLine:
ggplot(lines, aes(x = x, y = y, colour = colour, size = width, group = 1)) +
layer(stat = StatLink2, geom = GeomLine,
position = position_identity(),
params = list(n = 10, lineend = 'round'))
sorting by x doesn’t solve it:
dplyr::arrange(lines, x) |>
ggplot(aes(x = x, y = y, colour = colour, size = width, group = 1)) +
layer(stat = StatLink2, geom = GeomLine,
position = position_identity(),
params = list(n = 10, lineend = 'round'))
Additionally, if a "GeomLine" like behavior is supported, adding more interpolation variants would allow for drawing spline interpolated lines, and others.
Currently, the
stat_link*
family plots paths, but it would be great to have a version that works likeGeomLine
(i.e., drawn by along the x-value), or at least support for mixing withGeomLine
:default
geom_link2
stat and geom:doesn’t work with
GeomLine
:sorting by x doesn’t solve it:
Created on 2023-10-25 with reprex v2.0.2
Additionally, if a "GeomLine" like behavior is supported, adding more interpolation variants would allow for drawing spline interpolated lines, and others.
For example:
Created on 2023-10-25 with reprex v2.0.2
Thanks!