Skip to content

Instantly share code, notes, and snippets.

@statwonk
Created June 1, 2019 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statwonk/d5737cf7778c92e63aaf8623a29d0f64 to your computer and use it in GitHub Desktop.
Save statwonk/d5737cf7778c92e63aaf8623a29d0f64 to your computer and use it in GitHub Desktop.
;O{) # o-----\. # /.;/?}
library(tidyverse)
plot.new()
par(bg = "black")
plot(density(rweibull(1e6, 2, 0.1)), col = "pink3", lwd = 1, ylim = c(0, 20),
xlab = "", ylab = "", main = "Weibull distribution", axes = FALSE)
seq(1, 5, 0.25) %>%
map(function(x){ rweibull(1e6, x, 0.1)}) %>%
map(function(x) { density(x) %>%
lines(col = sample(colors(), 1),
lwd = sample(seq(0.1, 3, 0.1), 1),
lty = sample(1:9, 1))}) %>%
invisible() # ;O{)
# o-----\.
# /.;/?}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment