Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# bayesplot (development version)

* Fixed bug in `mcmc_pairs()` (introduced in bayesplot 1.10.0) where some panels' divergences/treedepth hits were missing(#555)
* Unified density-control argument defaults (`bw`, `adjust`, `kernel`, `n_dens`) to use `NULL` with internal fallbacks. No change in user-facing behavior.
* `prepare_mcmc_array()` now warns instead of erroring on `NA`s in the input.
* Fixed `validate_chain_list()` colnames check to compare all chains, not just the first two.
Expand Down
10 changes: 8 additions & 2 deletions R/mcmc-scatterplots.R
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,14 @@ mcmc_pairs <- function(x,
divs_j_fac <- factor(as.logical(divs_j),
levels = c(FALSE, TRUE),
labels = c("NoDiv", "Div"))
# pass the indicator via `data` so each panel keeps its own values
# (a bare loop variable in aes() is only evaluated at plot-build time,
# when it would have just the value from the last panel)
# https://github.com/stan-dev/bayesplot/issues/555
plots[[j]] <- plots[[j]] +
geom_point(
aes(color = divs_j_fac, size = divs_j_fac),
aes(color = .data$Divergent, size = .data$Divergent),
data = data.frame(x = x_j[, 1], y = x_j[, 2], Divergent = divs_j_fac),
shape = np_style$shape[["div"]],
alpha = np_style$alpha[["div"]],
na.rm = TRUE
Expand All @@ -418,7 +423,8 @@ mcmc_pairs <- function(x,
labels = c("NoHit", "Hit"))
plots[[j]] <- plots[[j]] +
geom_point(
aes(color = max_td_hit_j_fac, size = max_td_hit_j_fac),
aes(color = .data$MaxTreedepth, size = .data$MaxTreedepth),
data = data.frame(x = x_j[, 1], y = x_j[, 2], MaxTreedepth = max_td_hit_j_fac),
shape = np_style$shape[["td"]],
alpha = np_style$alpha[["td"]],
na.rm = TRUE
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading