Skip to content

Commit b98d1e3

Browse files
authored
Merge pull request #483 from utkarshpawade/fix/use-geom-col-instead-of-geom-bar-stat-identity
Replace geom_bar(stat = identity) with geom_col()
2 parents 906cd5c + de9127e commit b98d1e3

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* New functions `mcmc_dots` and `mcmc_dots_by_chain` for dot plots of MCMC draws by @behramulukir (#402)
1212
* Default to `quantiles=100` for all dot plots by @behramulukir (#402)
1313
* Use `"neff_ratio"` consistently in diagnostic color scale helpers to avoid relying on partial matching of `"neff"`.
14+
* Replace uses of `geom_bar(stat = "identity")` with the more idiomatic ggplot2 form `geom_col()`
1415

1516
# bayesplot 1.15.0
1617

R/bayesplot-colors.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ plot_scheme <- function(scheme = NULL) {
222222
)
223223

224224
ggplot(color_data, aes(x = .data$name, y = .data$value, fill = .data$group)) +
225-
geom_bar(
225+
geom_col(
226226
width = .5,
227-
stat = "identity",
228227
color = "white",
229228
linewidth = 0.1
230229
) +

R/mcmc-diagnostics.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,7 @@ drop_NAs_and_warn <- function(x) {
541541
bayesplot_theme_get()
542542
if (style == "bar") {
543543
graph <- graph +
544-
geom_bar(
545-
position = "identity",
546-
stat = "identity",
544+
geom_col(
547545
linewidth = 0.2,
548546
fill = get_color("l"),
549547
color = get_color("lh"),

0 commit comments

Comments
 (0)