From 927ec2bf49b03a8b408869b027f14600255e7f76 Mon Sep 17 00:00:00 2001 From: Utkarsh Date: Sun, 15 Mar 2026 20:09:45 +0530 Subject: [PATCH 1/2] Replace geom_bar(stat = identity) with geom_col() --- NEWS.md | 1 + R/bayesplot-colors.R | 3 +-- R/mcmc-diagnostics.R | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index bf6aaef8..a8cdfc6c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,7 @@ * 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"`. +* Replace `geom_bar(stat = "identity")` with `geom_col()` in `plot_scheme()` and `mcmc_acf()` for clarity and modern ggplot2 style. # bayesplot 1.15.0 diff --git a/R/bayesplot-colors.R b/R/bayesplot-colors.R index a581a176..83977470 100644 --- a/R/bayesplot-colors.R +++ b/R/bayesplot-colors.R @@ -222,9 +222,8 @@ plot_scheme <- function(scheme = NULL) { ) ggplot(color_data, aes(x = .data$name, y = .data$value, fill = .data$group)) + - geom_bar( + geom_col( width = .5, - stat = "identity", color = "white", linewidth = 0.1 ) + diff --git a/R/mcmc-diagnostics.R b/R/mcmc-diagnostics.R index 2a71b8e0..92c6fef4 100644 --- a/R/mcmc-diagnostics.R +++ b/R/mcmc-diagnostics.R @@ -541,9 +541,7 @@ drop_NAs_and_warn <- function(x) { bayesplot_theme_get() if (style == "bar") { graph <- graph + - geom_bar( - position = "identity", - stat = "identity", + geom_col( linewidth = 0.2, fill = get_color("l"), color = get_color("lh"), From de9127efa33a7a3790a533066c8c4aabec88aefb Mon Sep 17 00:00:00 2001 From: Jonah Gabry Date: Mon, 16 Mar 2026 14:47:07 -0600 Subject: [PATCH 2/2] Update NEWS.md --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index a8cdfc6c..a69d7e86 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,7 +11,7 @@ * 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"`. -* Replace `geom_bar(stat = "identity")` with `geom_col()` in `plot_scheme()` and `mcmc_acf()` for clarity and modern ggplot2 style. +* Replace uses of `geom_bar(stat = "identity")` with the more idiomatic ggplot2 form `geom_col()` # bayesplot 1.15.0