12
12
# ' @template args-transformations
13
13
# ' @template args-facet_args
14
14
# ' @param ... Currently ignored.
15
+ # ' @param alpha Passed to the geom to control the transparency.
15
16
# '
16
17
# ' @template return-ggplot
17
18
# '
@@ -113,7 +114,8 @@ mcmc_hist <- function(x,
113
114
facet_args = list (),
114
115
binwidth = NULL ,
115
116
breaks = NULL ,
116
- freq = TRUE ) {
117
+ freq = TRUE ,
118
+ alpha = 1 ) {
117
119
check_ignored_arguments(... )
118
120
.mcmc_hist(
119
121
x ,
@@ -125,6 +127,7 @@ mcmc_hist <- function(x,
125
127
breaks = breaks ,
126
128
by_chain = FALSE ,
127
129
freq = freq ,
130
+ alpha = alpha ,
128
131
...
129
132
)
130
133
}
@@ -137,7 +140,8 @@ mcmc_dens <- function(x,
137
140
transformations = list (),
138
141
... ,
139
142
facet_args = list (),
140
- trim = FALSE ) {
143
+ trim = FALSE ,
144
+ alpha = 1 ) {
141
145
check_ignored_arguments(... )
142
146
.mcmc_dens(
143
147
x ,
@@ -147,6 +151,7 @@ mcmc_dens <- function(x,
147
151
facet_args = facet_args ,
148
152
by_chain = FALSE ,
149
153
trim = trim ,
154
+ alpha = alpha ,
150
155
...
151
156
)
152
157
}
@@ -161,7 +166,8 @@ mcmc_hist_by_chain <- function(x,
161
166
... ,
162
167
facet_args = list (),
163
168
binwidth = NULL ,
164
- freq = TRUE ) {
169
+ freq = TRUE ,
170
+ alpha = 1 ) {
165
171
check_ignored_arguments(... )
166
172
.mcmc_hist(
167
173
x ,
@@ -172,6 +178,7 @@ mcmc_hist_by_chain <- function(x,
172
178
binwidth = binwidth ,
173
179
by_chain = TRUE ,
174
180
freq = freq ,
181
+ alpha = alpha ,
175
182
...
176
183
)
177
184
}
@@ -312,6 +319,7 @@ mcmc_violin <- function(x,
312
319
breaks = NULL ,
313
320
by_chain = FALSE ,
314
321
freq = TRUE ,
322
+ alpha = 1 ,
315
323
... ) {
316
324
x <- prepare_mcmc_array(x , pars , regex_pars , transformations )
317
325
@@ -330,7 +338,8 @@ mcmc_violin <- function(x,
330
338
size = .25 ,
331
339
na.rm = TRUE ,
332
340
binwidth = binwidth ,
333
- breaks = breaks
341
+ breaks = breaks ,
342
+ alpha = alpha
334
343
)
335
344
336
345
facet_args [[" scales" ]] <- facet_args [[" scales" ]] %|| % " free"
@@ -373,6 +382,7 @@ mcmc_violin <- function(x,
373
382
geom = c(" density" , " violin" ),
374
383
probs = c(0.1 , 0.5 , 0.9 ),
375
384
trim = FALSE ,
385
+ alpha = 1 ,
376
386
... ) {
377
387
x <- prepare_mcmc_array(x , pars , regex_pars , transformations )
378
388
data <- melt_mcmc(x )
@@ -396,7 +406,7 @@ mcmc_violin <- function(x,
396
406
} else {
397
407
list (x = ~ Value )
398
408
}
399
- geom_args <- list (size = 0.5 , na.rm = TRUE )
409
+ geom_args <- list (size = 0.5 , na.rm = TRUE , alpha = alpha )
400
410
if (violin ) {
401
411
geom_args [[" draw_quantiles" ]] <- probs
402
412
} else {
0 commit comments