Created
January 1, 2011 16:55
-
-
Save trialsolution/761847 to your computer and use it in GitHub Desktop.
drawing "polar roses" curves in polar coordinate system
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
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment