Skip to content

bayesplot

1.16.0Package record

Plotting for Bayesian Models

54packages dependsuggested by 56
2.4Mdownloads / year
96.2%test coverage
12/13flavors OK

Overview

About

Plotting functions for posterior analysis, MCMC diagnostics, prior and posterior predictive checks, and other visualizations to support the applied Bayesian workflow advocated in Gabry, Simpson, Vehtari, Betancourt, and Gelman (2019) doi:10.1111/rssa.12378. The package is designed not only to provide convenient functionality for users, but also a common set of functions that can be easily used by developers working on a variety of R packages for Bayesian modeling, particularly (but not exclusively) packages interfacing with 'Stan'.

Changes in 1.16.0

New plots and plotting capabilities

  • mcmc_dots() and mcmc_dots_by_chain() are new quantile dot plots for MCMC draws. All dot-plot functions now default to quantiles = 100. @behramulukir (#402)
  • ppc_calibration() and the new grouped, overlay, LOO, and _data() variants provide calibration plots for models with binary outcomes. @TeemuSailynoja and @florence-bockting (#352)
  • ppc_loo_pit_ecdf(), ppc_pit_ecdf(), and ppc_pit_ecdf_grouped() gain method = "correlated" for dependence-aware uniformity tests and visualization of influential ECDF regions. The existing "independent" method remains the default but is superseded. @florence-bockting (#428)
Show all changes in 1.16.0Hide the rest of the changes in 1.16.0
  • ppc_rootogram_grouped() is a new grouped and faceted rootogram supporting all existing rootogram styles. @behramulukir and @jgabry (#419)
  • ppd_*() distribution and test-statistic functions gain show_marginal for adding the marginal predictive distribution; defaults are unchanged. @mattansb (#425)

Other improvements and behavior changes

  • mcmc_areas(), mcmc_areas_ridges(), mcmc_dens(), mcmc_dens_chains(), and mcmc_dens_overlay() gain a bounds argument for bounded density estimation, as do their _data() companions and the PPC and PPD density functions. @VisruthSK (#317)
  • mcmc_trace() now officially supports the highlight and alpha arguments for highlighting a chain with lines. @jgabry (#552)
  • ppc_*() and ppd_*() functions now accept posterior::draws objects for predictive draws. @ishaan-arora-1 (#542)
  • ppc_ecdf_overlay(), ppc_ecdf_overlay_grouped(), and ppd_ecdf_overlay() now always draw ECDFs as step functions; their discrete argument is deprecated. @utkarshpawade (#259)
  • prepare_mcmc_array() now warns rather than errors when draws contain NAs, allowing MCMC plots of ragged arrays padded with missing values. It also rejects unequal chain lengths and mismatched parameter names that could previously corrupt or misalign draws. @utkarshpawade (#250, #498, #528)

Bug fixes and compatibility

  • Improved compatibility with ggplot2 4.0 and current dplyr and tidyselect releases, eliminating deprecation and small-group warnings and fixing linetype legends. @jgabry, @BjarkeHautop, @ishaan-arora-1, and @utkarshpawade (#410, #412, #414, #442, #446, #448, #450, #458, #468)
  • mcmc_pairs() now correctly marks divergences and maximum-treedepth hits in every panel; a regression introduced in bayesplot 1.10.0 could omit or misassign them. @jgabry (#555)
  • nuts_params() preserves array dimensions when a single parameter is selected from a CmdStanMCMC object and gives clear errors for empty or zero-row list inputs. @utkarshpawade (#530, #534)
  • ppc_loo_pit_data() now validates user-supplied pit values at the entry point and rejects nonnumeric, missing, or out-of-range inputs. @utkarshpawade (#503)

There were many other non user-facing changes, including internal refactoring

and improved test coverage. The full changelog can be found at:

https://github.com/stan-dev/bayesplot/compare/v1.15.0...v1.16.0

From NEWS.md in the release

Install

Health

CRAN checks
1ERROR12OK
Check messages
ERRORtestsr-oldrel-macos-arm64
Running ‘testthat.R’ [78s/79s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(bayesplot)
  This is bayesplot version 1.16.0
  - Online documentation and vignettes at mc-stan.org/bayesplot
  - bayesplot theme set to bayesplot::theme_default()
     * Does _not_ affect other ggplot2 plots
     * See ?bayesplot_theme_set for details on theme setting
  > 
  > Sys.unsetenv("R_TESTS")
  > test_check("bayesplot")
  Note: in most cases the default test statistic 'mean' is too weak to detect anything of interest.
  Note: in most cases the default test statistic 'mean' is too weak to detect anything of interest.
  The 'independent' method is superseded by the 'correlated' method.
  `stat_bin()` using `bins = 30`. Pick better value `binwidth`.
  `stat_bin()` using `bins = 30`. Pick better value `binwidth`.
  `stat_bin()` using `bins = 30`. Pick better value `binwidth`.
  `stat_bin()` using `bins = 30`. Pick better value `binwidth`.
  `stat_bin()`
...[truncated]...
est-ppc-test-statistics.R:291:3',
    'test-ppd-marginal.R:22:3', 'test-ppd-marginal.R:56:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-ppc-loo.R:14:3'): (code run outside of `test_that()`) ──────────
  Error in `vapply(x, FUN = match.arg(fun), FUN.VALUE = fun_val, item)`: values must be length 1500,
   but FUN(X[[1]]) result is length 0
  Backtrace:
      ▆
   1. ├─base::suppressWarnings(psis1 <- psis(-log_lik(fit), cores = 2)) at test-ppc-loo.R:14:3
   2. │ └─base::withCallingHandlers(...)
   3. ├─loo::psis(-log_lik(fit), cores = 2)
   4. └─loo:::psis.matrix(-log_lik(fit), cores = 2)
   5.   └─loo:::importance_sampling.matrix(...)
   6.     └─loo:::do_importance_sampling(...)
   7.       └─loo:::psis_apply(lw_list, "log_weights", fun_val = numeric(S))
   8.         └─base::vapply(x, FUN = match.arg(fun), FUN.VALUE = fun_val, item)
  
  [ FAIL 1 | WARN 16 | SKIP 89 | PASS 1496 ]
  Error:
  ! Test failures.
  Execution halted

CRAN check page ↗

Slowest check: 13.1 min · r-oldrel-macos-x86_64
Status changes
  • ERROR12 OK, 1 ERRORNow
  • ERROR10 OK, 2 NOTE, 1 ERROR2026-08-26
  • NOTE11 OK, 2 NOTE2026-07-16
  • OK13 OK2026-06-09
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK12 OK2026-04-25
Show 1 earlier changeHide 1 earlier change
  • NOTE11 OK, 3 NOTE2026-03-10
Advisories

none known

Documentation

In release 1.16.0
README· In the repository, left out of the releaseVignettesYes · 3 · dynamicNEWSYes · 100% structured · mentions 1.16.0Citation fileYes · cites a publicationWebsiteYes · pkgdown
Help pages
36 (2 internal)includes a package overview page
Examples that run
84%27 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran) · 4 never run
Exported functions with examples
97%
Documented parameters
72%
Return-value docs
94%
Help pages citing references
56%

Downloads

2.4M
CRAN downloads in the past year
Rank #209 · ~6.6K/day · ~200.8K/mo
Daily download trend is not available in this view yet.
187.6K30 days
737.7K90 days
2.4M1 year
Compare downloads with other packages →
Also on12.5K r2u179 autocran11K conda_forge627 c2d4u

Repository

444Stars
94Forks
56Open issues
14Open PRs
20Releases
2,469Commits
42Commit identities
r-packagestatistical-graphicsstanbayesianggplot2visualizationmcmcbayesian-workflow
License file reads as GPL-3.0 · 2,469 commits · Last activity 2026-10-12 · +0.5% stars, 30d · Default branch at 1.16.0.9000, ahead of CRAN 1.16.0 (checked 2026-10-18)
Responsiveness
How these are sampled
PRs merged (all time)
89%
Median days to close, 50 most recently updated closed issues
1
Median days to close, 50 most recently updated closed PRs
2

Stars over time

2025-10-02 · 4332026-10-14 · 444
PracticesBeta

11 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/stan-dev/bayesplot on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (3)
Contributing guideFunding

Funding links: GitHub Sponsors, mc-stan.org

The repository owner accepts GitHub Sponsors

Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-10-13 · The repository has a site deploy workflow

pkgdown site last built 2026-08-25

Coverage (1)
Coverage reporting
Show all practicesHide 2 practices
Automation and maintenance (1)
Dependabot
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • GitHub Copilotfirst seen 2025-12-30
    Pull request: opened by its own account
    Commits: 1 by its own account · at least 1 crediting it in the message
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
29 external dependencies (excludes base and recommended)

Installing bayesplot adds 43 packages (24 with compiled code, 35 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, ggridges 2.1 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none

People & History

People (15)
Author, Maintainer since 1.0.0 (2016)
Author · added in 1.4.0
Contributor · added in 1.16.0
Contributor · added in 1.6.0
Contributor · added in 1.16.0
Contributor · added in 1.16.0
Contributor · added in 1.6.0
Contributor · added in 1.8.0
Contributor · added in 1.6.0
Contributor · added in 1.16.0
Show 5 more contributorsHide 5 contributors
Contributor · added in 1.10.0
Contributor · added in 1.15.0
Contributor · added in 1.14.0
Contributor · added in 1.8.0
Contributor · added in 1.8.0
Listed in earlier versions (1)
no longer listed · 1.0.0 to 1.5.0
Releases (21)

Pick two releases to compare their code metrics.

  • 1.16.0Latest
    record
    2026-08-25 · current release · diff ↗ ·
    added 10 exports
    mcmc_dots, mcmc_dots_by_chain, ppc_calibration, ppc_calibration_data, ppc_calibration_grouped, ppc_calibration_overlay, ppc_calibration_overlay_grouped, ppc_loo_calibration, ppc_loo_calibration_grouped, ppc_rootogram_grouped
  • R
    R 4.6.0 released · 2026-04-24
  • 1.15.0
    record
    2025-12-12 · diff ↗
  • 1.14.0
    record
    2025-09-01 · diff ↗ ·
    added 2 exports
    ppc_dots, ppd_dots
  • 1.13.0
    record
    2025-06-19 · diff ↗ ·
    added 1 export
    ppc_loo_pit_ecdf
  • R
    R 4.5.0 released · 2025-04-11
  • 1.12.0
    record
    2025-04-10 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • 1.11.1
    record
    2024-02-15 · diff ↗
  • 1.11.0
    record
    2024-01-31 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 1.10.0
    record
    2022-11-16 · diff ↗ ·
    added 3 exports
    mcmc_rank_ecdf, ppc_pit_ecdf, ppc_pit_ecdf_grouped
  • R
    R 4.2.0 released · 2022-04-22
  • 1.9.0
    record
    2022-03-10 · diff ↗ ·
    added 29 exports
    available_ppd, ppc_bars_data, ppc_error_data, ppc_error_scatter_avg_grouped, ppc_km_overlay_grouped, ppc_scatter_avg_data, ppc_scatter_data, ppc_stat_data, ppc_stat_freqpoly, ppd_boxplot, ppd_data, ppd_dens, ppd_dens_overlay, ppd_ecdf_overlay, ppd_freqpoly, ppd_freqpoly_grouped, ppd_hist, ppd_intervals, ppd_intervals_data, ppd_intervals_grouped, ppd_ribbon, ppd_ribbon_data, ppd_ribbon_grouped, ppd_stat, ppd_stat_2d, ppd_stat_data, ppd_stat_freqpoly, ppd_stat_freqpoly_grouped, ppd_stat_grouped
  • 1.8.1
    record
    2021-06-14 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
Show 16 earlier eventsHide 16 earlier events
  • 1.8.0
    record
    2021-01-10 · diff ↗ ·
    added 4 exports
    ppc_dens_overlay_grouped, ppc_ecdf_overlay_grouped, ppc_km_overlay, ppc_loo_pit_data
  • 1.7.2
    record
    2020-05-28 · diff ↗
  • R
    R 4.0.0 released · 2020-04-24
  • 1.7.1
    record
    2019-12-02 · diff ↗
  • 1.7.0
    record
    2019-05-23 · diff ↗ ·
    added 6 exports
    mcmc_rank_hist, mcmc_rank_overlay, mcmc_trace_data, param_glue, param_range, vars
  • R
    R 3.6.0 released · 2019-04-26
  • 1.6.0
    record
    2018-08-02 · diff ↗ ·
    added 4 exports
    bayesplot_theme_get, bayesplot_theme_replace, bayesplot_theme_set, bayesplot_theme_update
  • R
    R 3.5.0 released · 2018-04-23
  • 1.5.0
    record
    2018-03-30 · diff ↗ ·
    added 9 exports
    mcmc_areas_data, mcmc_areas_ridges, mcmc_areas_ridges_data, mcmc_dens_chains, mcmc_dens_chains_data, mcmc_intervals_data, ppc_data, ppc_loo_pit_overlay, ppc_loo_pit_qq
  • 1.4.0
    record
    2017-09-12 · diff ↗ ·
    added 9 exports
    mcmc_neff_data, mcmc_parcoord, mcmc_parcoord_data, mcmc_rhat_data, parcoord_style_np, ppc_intervals_data, ppc_ribbon_data, scatter_style_np, trace_style_np
  • 1.3.0
    record
    2017-08-07 · diff ↗
  • R
    R 3.4.0 released · 2017-04-21
  • 1.2.0
    record
    2017-04-12 · diff ↗ ·
    added 14 exports
    abline_01, mcmc_hex, mcmc_pairs, mcmc_recover_hist, mcmc_recover_scatter, overlay_function, pairs_condition, pairs_style_np, ppc_bars, ppc_bars_grouped, ppc_loo_intervals, ppc_loo_pit, ppc_loo_ribbon, ppc_rootogram
  • 1.1.0
    record
    2016-12-20 · diff ↗ ·
    added 3 exports
    bayesplot_grid, mcmc_recover_intervals, ppc_error_hist_grouped
  • 1.0.0
    record
    2016-11-18
  • R
    R 3.3.0 released · 2016-05-03

Package metadata

First published
2016-11-18
Total releases
21 / 10 yrs
License
GPL (>= 3) OSI
Additional repositories
stan-dev.r-universe.dev
Minimum R
≥ 4.1.0
Download size
5.0 MB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("bayesplot")

The package provides a citation file that builds its entry when R runs it. Run citation() to see it.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for bayesplot version 1.16.0 [Data set]. HJJB, LLC. Data release v2026-10-20. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-20, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy