Skip to content

Commit

Permalink
Make mcmc_pairs() return a ggplot object instead of a bayesplot_group…
Browse files Browse the repository at this point in the history
… object (Fix stan-dev#268)
  • Loading branch information
billdenney committed May 24, 2021
1 parent 96105e2 commit 09ff64d
Show file tree
Hide file tree
Showing 7 changed files with 478 additions and 176 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

Items for next release go here

### Breaking changes

* `mcmc_pairs()` now returns a ggplot object rather than a `bayesplot_grid`
object. Code that modified the output of `mcmc_pairs()` will need to change.
(#268, @billdenney)

# bayesplot 1.8.0

Expand Down
9 changes: 3 additions & 6 deletions R/mcmc-distributions.R
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,8 @@ mcmc_violin <- function(x,
n_param <- num_params(data)

graph <- ggplot(data, aes(x = ~ value)) +
geom_histogram(
set_hist_aes(freq),
fill = get_color("mid"),
color = get_color("mid_highlight"),
size = .25,
na.rm = TRUE,
geom_mcmc_hist(
freq = freq,
binwidth = binwidth,
breaks = breaks
)
Expand Down Expand Up @@ -450,3 +446,4 @@ mcmc_violin <- function(x,
yaxis_title(on = n_param == 1 && violin) +
xaxis_title(on = n_param == 1)
}

0 comments on commit 09ff64d

Please sign in to comment.