Skip to content

Instantly share code, notes, and snippets.

@nikosbosse
Last active January 14, 2020 21:57
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 nikosbosse/3be266dac8d3264a6cfed214312b1caa to your computer and use it in GitHub Desktop.
Save nikosbosse/3be266dac8d3264a6cfed214312b1caa to your computer and use it in GitHub Desktop.
Two Histograms in One Plot
## illustrate prior
prior <- rnorm(100000, 0.5, 0.5)
## extract posterior from Stan
posterior <- extract(my_stanfitobject)$my_parameter
## alternatively, create some second vector
vector2 <- rnorm(100000, 2, 0.8)
plot_two_histograms(prior, vector2, breaks = 100,
upper_limit = 6,
xlab = "vec1 is blue, vec2 is pink")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment