GenomicsBootCamp

HappyValentinesDay

Feb 14th, 2022 (edited)
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.41 KB | None | 0 0
  1. # Happy Valentine's Day!
  2.  
  3. library(tidyverse)
  4.  
  5. x <- function(t){
  6.   16 * sin(t)^3
  7. }
  8.  
  9. y <- function(t){
  10.   13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t)
  11. }
  12.  
  13. tibble(t = seq(0, 2*pi, by = 0.01)) %>%
  14.   mutate(x = x(t),
  15.          y = y(t)) %>%
  16.   ggplot(mapping = aes(x, y)) +
  17.   geom_polygon(fill = "#A7281E",
  18.                color = "#A7281E",
  19.                alpha = 0.9) +
  20.   coord_equal() +
  21.   theme_void()
  22.  
Add Comment
Please, Sign In to add comment