-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
geom_segment mitre/bevel with linewidth gradient and color gradient #5349
Comments
If you need some kind of interpolation of paths, there already is library(ggplot2)
ggplot(data.frame(th = seq(0, pi, length.out=12)), aes(sin(th), cos(th), col=th)) +
ggforce::geom_link2(aes(linewidth = th), lineend = "round") Created on 2023-07-12 with reprex v2.0.2 I'm afraid that it won't be straightforward to implement your proposal without essentially rewriting the paths part of a graphics engine. However if you're interested, Paul Murell has written a series of blogs about variable-width lines: https://www.stat.auckland.ac.nz/~paul/Reports/VWline/vwline-intro/power-curve.html |
I'm going to close this as it is a limitation with the graphics system. If anyone finds an elegant solution to this, they're welcome to prepare a PR. |
I would like to see these rectangles mitred and also filled with a color gradient. Ideally the
aes(linewidth=th)
case would also work, in which case each segment is a trapezoid before joining. I'm willing to write the PR. Does the current gradient-less behavior need to be available through something likegeom_path(gradient=FALSE)
?The text was updated successfully, but these errors were encountered: