Skip to content
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Fixed test in `test-ppc-distributions.R` that incorrectly used `ppc_dens()` instead of `ppd_dens()` when testing PPD functions
* New functions `mcmc_dots` and `mcmc_dots_by_chain` for dot plots of MCMC draws by @behramulukir (#402)
* Default to `quantiles=100` for all dot plots by @behramulukir (#402)
* Use `"neff_ratio"` consistently in diagnostic color scale helpers to avoid relying on partial matching of `"neff"`.

# bayesplot 1.15.0

Expand Down
12 changes: 6 additions & 6 deletions R/mcmc-diagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ mcmc_neff <- function(ratio, ..., size = NULL) {
linetype = 2,
linewidth = 0.25) +
labs(y = NULL, x = expression(N[eff]/N)) +
scale_fill_diagnostic("neff") +
scale_color_diagnostic("neff") +
scale_fill_diagnostic("neff_ratio") +
scale_color_diagnostic("neff_ratio") +
scale_x_continuous(
breaks = breaks,
# as.character truncates trailing zeroes, while ggplot default does not
Expand Down Expand Up @@ -287,8 +287,8 @@ mcmc_neff_hist <- function(ratio, ..., binwidth = NULL, bins = NULL, breaks = NU
binwidth = binwidth,
bins = bins,
breaks = breaks) +
scale_color_diagnostic("neff") +
scale_fill_diagnostic("neff") +
scale_color_diagnostic("neff_ratio") +
scale_fill_diagnostic("neff_ratio") +
labs(x = expression(N[eff]/N), y = NULL) +
dont_expand_y_axis(c(0.005, 0)) +
yaxis_title(FALSE) +
Expand Down Expand Up @@ -424,12 +424,12 @@ diagnostic_points <- function(size = NULL) {

# Functions wrapping around scale_color_manual() and scale_fill_manual(), used to
# color the intervals by rhat value
scale_color_diagnostic <- function(diagnostic = c("rhat", "neff")) {
scale_color_diagnostic <- function(diagnostic = c("rhat", "neff_ratio")) {
d <- match.arg(diagnostic)
diagnostic_color_scale(d, aesthetic = "color")
}

scale_fill_diagnostic <- function(diagnostic = c("rhat", "neff")) {
scale_fill_diagnostic <- function(diagnostic = c("rhat", "neff_ratio")) {
d <- match.arg(diagnostic)
diagnostic_color_scale(d, aesthetic = "fill")
}
Expand Down
Loading