@@ -224,20 +224,7 @@ mcmc_nuts_acceptance <-
224
224
data = chain_scatter_data
225
225
)
226
226
}
227
-
228
- nuts_plot <- gridExtra :: arrangeGrob(
229
- hists ,
230
- gridExtra :: arrangeGrob(empty_grob()),
231
- gridExtra :: arrangeGrob(
232
- empty_grob(),
233
- scatter ,
234
- empty_grob(),
235
- ncol = 3 ,
236
- widths = c(1 , 3 , 1 )
237
- ),
238
- nrow = 3 ,
239
- heights = c(1 , 0.1 , 1 )
240
- )
227
+ nuts_plot <- gridExtra :: arrangeGrob(hists , scatter , nrow = 2 )
241
228
as_bayesplot_grid(nuts_plot )
242
229
}
243
230
@@ -409,19 +396,10 @@ mcmc_nuts_treedepth <- function(x, lp, chain = NULL, ...) {
409
396
chain_violin(violin_accept_stat_data , chain )
410
397
}
411
398
412
- nuts_plot <- gridExtra :: arrangeGrob(
413
- gridExtra :: arrangeGrob(
414
- violin_lp , violin_accept_stat ,
415
- nrow = 1
416
- ),
417
- gridExtra :: arrangeGrob(
418
- empty_grob()
419
- ),
420
- gridExtra :: arrangeGrob(
421
- empty_grob(), hist_td , empty_grob(),
422
- ncol = 3 , widths = c(1 , 3 , 1 )
423
- ),
424
- nrow = 3 , heights = c(1 , 0.1 , 1 )
399
+ nuts_plot <- gridExtra :: grid.arrange(
400
+ gridExtra :: arrangeGrob(violin_lp , violin_accept_stat , nrow = 1 ),
401
+ hist_td ,
402
+ nrow = 2
425
403
)
426
404
as_bayesplot_grid(nuts_plot )
427
405
}
@@ -572,7 +550,3 @@ chain_violin <-
572
550
alpha = alpha
573
551
)
574
552
}
575
-
576
- empty_grob <- function () {
577
- structure(list (), class = c(" grob" , " gDesc" ))
578
- }
0 commit comments