Skip to content

Instantly share code, notes, and snippets.

@moritzpschwarz
Created September 5, 2020 16:35
Show Gist options
  • Save moritzpschwarz/4a8262539aab43c95d1727b9a09e6fc1 to your computer and use it in GitHub Desktop.
Save moritzpschwarz/4a8262539aab43c95d1727b9a09e6fc1 to your computer and use it in GitHub Desktop.
Spread the love :) <3
library(tidyverse)
data.frame(t = seq(0, 2 * pi, by = 0.1)) %>%
mutate(across(.cols = t,
.fns = list(y=~13*cos(.)-5*cos(2*.)-2*cos(3*.)-cos(4*.),x = ~16*sin(.)^3))) %>%
ggplot(aes(x=t_x,y=t_y)) +
geom_polygon(fill="red3") +
labs(x=NULL,y=NULL) +
theme(panel.background = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank()) +
coord_fixed()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment