Created
November 18, 2019 00:26
-
-
Save Akiyah/b33e54c0f17bec7cadf1ac3348119ea6 to your computer and use it in GitHub Desktop.
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
draw <- function(l, filename) { | |
png(filename, width=500, height=500) | |
barplot(dpois(0:10, l), names.arg=0:10, ylim=c(0,1), col="#993435") | |
text(5, 0.8, paste0("λ=", sprintf("%1.1f", l)), cex=5) | |
dev.off() | |
} | |
l <- (1:50) / 10 | |
for (i in 1:length(l)) { | |
draw(l[i], sprintf("plot_%04d.png", i)) | |
draw(l[i], sprintf("plot_%04d.png", length(l)*2 - i + 1)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment