Guest User

Untitled

a guest
Jul 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. require(ggplot2)
  2.  
  3. #data points
  4. p <- data.frame(t=seq(-2*pi, 2*pi, 0.1))
  5.  
  6. #1.. drawing polar rose
  7. c <- ggplot(p, aes(x=t, y=cos(3*t)))
  8. c + geom_line() + coord_polar()
  9.  
  10. #2.. another one with sine
  11. c <- ggplot(p, aes(x=t, y=2*sin(4*t)))
  12. c + geom_line() + coord_polar()
  13.  
  14. #3.. Archimedean spiral
  15. c <- ggplot(p, aes(x=t, y=2+4*t))
  16. c + geom_line() + coord_polar()
Add Comment
Please, Sign In to add comment