Last active
August 14, 2019 13:00
-
-
Save gkaramanis/e899ae58ecc80be8e0ee7b9ecca3887b to your computer and use it in GitHub Desktop.
Draw a leaf with closed b-spline shape in ggforce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggforce) | |
library(ggplot2) | |
leaf <- data.frame( | |
x = c(1.6, 1.5, 1.8, 1.5, 1.6, 1.3), | |
y = c(2, 2, 1.5, 1, 1, 1.5) | |
) | |
ggplot(leaf, aes(x, y)) + | |
geom_polygon(fill = NA, colour = 'grey') + | |
geom_point(colour = 'red') + | |
geom_bspline_closed(alpha = 0.7) + | |
coord_fixed() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment