Created
October 20, 2020 21:17
-
-
Save oliviergimenez/0adf188ca878499b6e186b8b1cbdc62a to your computer and use it in GitHub Desktop.
Plot a red heart
This file contains 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
# https://twitter.com/GeoffZahn/status/1318653420027273216?s=20 | |
library(tidyverse) | |
data_frame(t=seq(-pi, 0, .001), | |
x1=16*(sin(t))^2, | |
x2=-x1, | |
y=13*cos(t) -5 * cos(2*t) -2*cos(3*t) - cos(4*t)) %>% | |
gather(side, x, x1, x2) %>% | |
ggplot(aes(x,y)) + | |
geom_polygon(fill="red") + | |
coord_fixed() + | |
theme_minimal() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment