Skip to contents

bayesplot (development version)

  • 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 NAs in the input.
  • Fixed validate_chain_list() colnames check to compare all chains, not just the first two.
  • Added test verifying legend_move("none") behaves equivalently to legend_none().
  • Added singleton-dimension edge-case tests for exported _data() functions.
  • Validate empty list and zero-row matrix inputs in nuts_params.list().
  • Validate user-provided pit values in ppc_loo_pit_data() and ppc_loo_pit_qq(), rejecting non-numeric inputs, missing values, and values outside [0, 1].
  • New show_marginal argument to ppd_*() functions to show the PPD - the marginal predictive distribution by @mattansb (#425)
  • ppc_ecdf_overlay(), ppc_ecdf_overlay_grouped(), and ppd_ecdf_overlay() now always use geom_step(). The discrete argument is deprecated.
  • Fixed missing drop = FALSE in nuts_params.CmdStanMCMC().
  • Replace apply() with storage.mode() for integer-to-numeric matrix conversion in validate_predictions().
  • Fixed is_chain_list() to correctly reject empty lists instead of silently returning TRUE.
  • Added unit tests for mcmc_areas_ridges_data(), mcmc_parcoord_data(), and mcmc_trace_data().
  • Added unit tests for ppc_error_data() and ppc_loo_pit_data() covering output structure, argument handling, and edge cases.
  • Added vignette sections demonstrating *_data() companion functions for building custom ggplot2 visualizations (#435)
  • Extract drop_singleton_values() helper in mcmc_nuts_treedepth() to remove duplicated filtering logic.
  • Eliminate redundant data processing in mcmc_areas_data() by reusing the prepared MCMC array for both interval and density computation.
  • Validate equal chain lengths in validate_df_with_chain(), reject missing chain labels, and renumber data-frame chain labels internally when converting to arrays.
  • Added unit tests for previously untested edge cases in param_range(), param_glue(), and tidyselect_parameters() (no-match, partial-match, and negation behavior).
  • Bumped minimum version for rstantools from >= 1.5.0 to >= 2.0.0 .
  • Use rlang::warn() and rlang::inform() for selected PPC user messages instead of base warning() and message().
  • Standardize input validation errors in ppc_km_overlay() and interpolation helpers to use rlang::abort() for consistent error handling.
  • Fix assignment-in-call bug in mcmc_rank_ecdf() (#).
  • Replaced deprecated dplyr and tidyselect functions (top_n, one_of, group_indices) with their modern equivalents to ensure future compatibility. (#431)
  • Documentation added for all exported *_data() functions (#209)
  • Improved documentation for binwidth, bins, and breaks arguments to clarify they are passed to ggplot2::geom_area() and ggdist::stat_dots() in addition to ggplot2::geom_histogram()
  • Improved documentation for freq argument to clarify it applies to frequency polygons in addition to histograms
  • 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".
  • Replace expand = c(mult, add) with ggplot2::expansion() helper in scale functions for consistency with ggplot2 >= 3.3.0 style.
  • Replace uses of geom_bar(stat = "identity") with the more idiomatic ggplot2 form geom_col()
  • New function ppc_rootogram_grouped for grouped rootogram plots by @behramulukir and @jgabry (#419)

bayesplot 1.15.0

CRAN release: 2025-12-12

bayesplot 1.14.0

CRAN release: 2025-08-31

bayesplot 1.13.0

CRAN release: 2025-06-18

bayesplot 1.12.0

CRAN release: 2025-04-10

bayesplot 1.11.1

CRAN release: 2024-02-15

  • Limit maximum number of evaluation points in ppc_pit_ecdf functions by default to 1000. by @TeemuSailynoja in #318

bayesplot 1.11.0

CRAN release: 2024-01-30

bayesplot 1.10.0

CRAN release: 2022-11-16

bayesplot 1.9.0

CRAN release: 2022-03-10

bayesplot 1.8.1

CRAN release: 2021-06-14

  • Fix R cmd check error on linux for CRAN

bayesplot 1.8.0

CRAN release: 2021-01-10

Bug fixes

New features

bayesplot 1.7.2

CRAN release: 2020-05-28

Compatibility with dplyr 1.0.0 (#219)

bayesplot 1.7.1

CRAN release: 2019-12-01

Release requested by CRAN to fix errors at https://cran.r-project.org/web/checks/check_results_bayesplot.html due to matrices also inheriting from “array” in R 4.0.

bayesplot 1.7.0

CRAN release: 2019-05-23

(GitHub issue/PR numbers in parentheses)

  • The pars argument of all MCMC plotting functions now supports tidy variable selection. See help("tidy-params", package="bayesplot") for details and examples. (#161, #183, #188)

  • Two new plots have been added for inspecting the distribution of ranks. Rank histograms were introduced by the Stan team’s new paper on MCMC diagnostics. (#178, #179)

    mcmc_rank_hist(): A traditional traceplot (mcmc_trace()) visualizes how sampled values the MCMC chains mix over the course of sampling. A rank histogram (mcmc_rank_hist()) visualizes how the ranks of values from the chains mix together. An ideal plot would show the ranks mixing or overlapping in a uniform distribution.

    mcmc_rank_overlay(): Instead of drawing each chain’s histogram in a separate panel, this plot draws the top edge of the chains’ histograms in a single panel.

  • Added mcmc_trace_data(), which returns the data used for plotting the trace plots and rank histograms. (Advances #97)

  • ColorBrewer palettes are now available as color schemes via color_scheme_set(). For example, color_scheme_set("brewer-Spectral") will use the Spectral palette. (#177, #190)

  • MCMC plots now also accept objects with an as.array method as input (e.g., stanfit objects). (#175, #184)

  • mcmc_trace() gains an argument iter1 which can be used to label the traceplot starting from the first iteration after warmup. (#14, #155, @mcol)

  • mcmc_areas() gains an argument area_method which controls how to draw the density curves. The default "equal area" constrains the heights so that the curves have the same area. As a result, a narrow interval will appear as a spike of density, while a wide, uncertain interval is spread thin over the x axis. Alternatively "equal height" will set the maximum height on each curve to the same value. This works well when the intervals are about the same width. Otherwise, that wide, uncertain interval will dominate the visual space compared to a narrow, less uncertain interval. A compromise between the two is "scaled height" which scales the curves from "equal height" using height * sqrt(height). (#163, #169)

  • mcmc_areas() correctly plots density curves where the point estimate does not include the highest point of the density curve. (#168, #169, @jtimonen)

  • mcmc_areas_ridges() draws the vertical line at x = 0 over the curves so that it is always visible.

  • mcmc_intervals() and mcmc_areas() raise a warning if prob_outer is ever less than prob. It sorts these two values into the correct order. (#138)

  • MCMC parameter names are now always converted to factors prior to plotting. We use factors so that the order of parameters in a plot matches the order of the parameters in the original MCMC data. This change fixes a case where factor-conversion failed. (#162, #165, @wwiecek)

  • The examples in ?ppc_loo_pit_overlay() now work as expected. (#166, #167)

  • Added "viridisD" as an alternative name for "viridis" to the supported colors.

  • Added "viridisE" (the cividis version of viridis) to the supported colors.

  • ppc_bars() and ppc_bars_grouped() now allow negative integers as input. (#172, @jeffpollock9)

bayesplot 1.6.0

CRAN release: 2018-08-02

(GitHub issue/PR numbers in parentheses)

bayesplot 1.5.0

CRAN release: 2018-03-30

(GitHub issue/PR numbers in parentheses)

  • New package documentation website: https://mc-stan.org/bayesplot/

  • Two new plots that visualize posterior density using ridgelines. These work well when parameters have similar values and similar densities, as in hierarchical models. (#104)

    • mcmc_dens_chains() draws the kernel density of each sampling chain.
    • mcmc_areas_ridges() draws the kernel density combined across chains.
    • Both functions have a _data() function to return the data plotted by each function.
  • mcmc_intervals() and mcmc_areas() have been rewritten. (#103)

    • They now use a discrete y-axis. Previously, they used a continuous scale with numeric breaks relabelled with parameter names; this design
      caused some unexpected behavior when customizing these plots.
    • mcmc_areas() now uses geoms from the ggridges package to draw density curves.
  • Added mcmc_intervals_data() and mcmc_areas_data() that return data plotted by mcmc_intervals() and mcmc_areas(). (Advances #97)

  • New ppc_data() function returns the data plotted by many of the PPC plotting functions. (Advances #97)

  • Added ppc_loo_pit_overlay() function for a better LOO PIT predictive check. (#123)

  • Started using vdiffr to add visual unit tests to the existing PPC unit tests. (#137)

bayesplot 1.4.0

CRAN release: 2017-09-12

(GitHub issue/PR numbers in parentheses)

bayesplot 1.3.0

CRAN release: 2017-08-07

(GitHub issue/PR numbers in parentheses)

bayesplot 1.2.0

CRAN release: 2017-04-12

A lot of new stuff in this release. (GitHub issue/PR numbers in parentheses)

Fixes

  • Avoid error in some cases when divergences is specified in call to mcmc_trace() but there are not actually any divergent transitions.

  • The merge_chains argument to mcmc_nuts_energy() now defaults to FALSE.

New features in existing functions

  • For mcmc_*() functions, transformations are recycled if transformations argument is specified as a single function rather than a named list. Thanks to @tklebel. (#64)

  • For ppc_violin_grouped() there is now the option of showing y as a violin, points, or both. Thanks to @silberzwiebel. (#74)

  • color_scheme_get() now has an optional argument i for selecting only a subset of the colors.

  • New color schemes: darkgray, orange, viridis, viridisA, viridisB, viridisC. The viridis schemes are better than the other schemes for trace plots (the colors are very distinct from each other).

New functions

bayesplot 1.1.0

CRAN release: 2016-12-20

(GitHub issue/PR numbers in parentheses)

Fixes

  • Images in vignettes should now render properly using png device. Thanks to TJ Mahr. (#51)

  • xaxis_title(FALSE) and yaxis_title(FALSE) now set axis titles to NULL rather than changing theme elements to element_blank(). This makes it easier to add axis titles to plots that don’t have them by default. Thanks to Bill Harris. (#53)

New features in existing functions

  • Add argument divergences to mcmc_trace() function. For models fit using HMC/NUTS this can be used to display divergences as a rug at the bottom of the trace plot. (#42)

  • The stat argument for all ppc_stat_*() functions now accepts a function instead of only the name of a function. (#31)

New functions

  • ppc_error_hist_grouped() for plotting predictive errors by level of a grouping variable. (#40)

  • mcmc_recover_intervals)( for comparing MCMC estimates to “true” parameter values used to simulate the data. (#56)

  • bayesplot_grid() for juxtaposing plots and enforcing shared axis limits. (#59)

bayesplot 1.0.0

CRAN release: 2016-11-18

Initial CRAN release