Skip to content

Commit fce7fbc

Browse files
committed
allow changing size of ridgelines
1 parent cfdd9c5 commit fce7fbc

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

R/mcmc-intervals.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ mcmc_intervals <- function(x,
245245

246246
#' @rdname MCMC-intervals
247247
#' @export
248+
#' @param size For `mcmc_areas()` and `mcmc_areas_ridges()`, the size of the
249+
#' ridgelines.
248250
mcmc_areas <- function(x,
249251
pars = character(),
250252
regex_pars = character(),
@@ -255,6 +257,7 @@ mcmc_areas <- function(x,
255257
prob_outer = 1,
256258
point_est = c("median", "mean", "none"),
257259
rhat = numeric(),
260+
size = NULL,
258261
bw = NULL,
259262
adjust = NULL,
260263
kernel = NULL,
@@ -330,6 +333,12 @@ mcmc_areas <- function(x,
330333
fill = NA
331334
)
332335

336+
if (!is.null(size)) {
337+
args_bottom$size <- size
338+
args_outer$size <- size
339+
args_inner$size <- size
340+
}
341+
333342
if (color_by_rhat) {
334343
args_bottom$mapping <- args_bottom$mapping %>%
335344
modify_aes_(color = ~ rhat_rating)
@@ -401,6 +410,7 @@ mcmc_areas_ridges <- function(x,
401410
...,
402411
prob_outer = 1,
403412
prob = 1,
413+
size = NULL,
404414
bw = NULL, adjust = NULL, kernel = NULL,
405415
n_dens = NULL) {
406416
check_ignored_arguments(...)
@@ -431,6 +441,9 @@ mcmc_areas_ridges <- function(x,
431441
fill = NA,
432442
stat = "identity"
433443
)
444+
if (!is.null(size)) {
445+
args_outer$size <- size
446+
}
434447

435448
layer_outer <- do.call(ggridges::geom_density_ridges, args_outer)
436449

man/MCMC-intervals.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)