Skip to content

Instantly share code, notes, and snippets.

@nikosbosse
Last active Jan 14, 2020
Embed
What would you like to do?
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