Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require(ggplot2)
- #data points
- p <- data.frame(t=seq(-2*pi, 2*pi, 0.1))
- #1.. drawing polar rose
- c <- ggplot(p, aes(x=t, y=cos(3*t)))
- c + geom_line() + coord_polar()
- #2.. another one with sine
- c <- ggplot(p, aes(x=t, y=2*sin(4*t)))
- c + geom_line() + coord_polar()
- #3.. Archimedean spiral
- c <- ggplot(p, aes(x=t, y=2+4*t))
- c + geom_line() + coord_polar()
Add Comment
Please, Sign In to add comment