Last active
March 9, 2016 22:45
-
-
Save coleoguy/b40191ca37cd4b71c076 to your computer and use it in GitHub Desktop.
plots a flower
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
flower <- function(x, y, colx="red", cex.x=1, cex.y=1, cex.f=1){ | |
petalsx <- cex.x * c(0, 1, 0, -1) | |
petalsy <- cex.y * c(1, 0, -1, 0) | |
# this loop prints the petals | |
for(i in 1:4){ | |
points(x + petalsx[i], | |
y + petalsy[i], | |
pch = 16, col = colx, | |
cex = cex.f) | |
} | |
# this prints the disk | |
points(x, y, pch = 16, col = "white", cex = cex.f * .65) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment