Skip to content

remove extra space from mcmc_areas #218

@avehtari

Description

@avehtari

I needed a mcmc_areas plot for a book, and noticed that all mcmc_areas plots have unnecessary extra space on top and bottom. This is not clear with just a few variables, but with 4 than more it's visible e.g. in bodyfat, candy, diabetes, mesquite, roaches, and winequality case studies at https://avehtari.github.io/modelselection/
It gets worse and worse with more variables.
For example this kind of call has empty space

mcmc_areas(as.matrix(fit), pars=vars(-'(Intercept)',-sigma))

and it can be fixed with

p0 <- mcmc_areas(as.matrix(fit0), pars=vars(-'(Intercept)',-sigma)
p0 <- p0 + scale_y_discrete(limits = rev(levels(p0$data$parameter)))
p0

This approach is a bit annoying, so I propose to make the plots tight by default.

This had slipped past previously as in notebooks there is plenty of space, but for a book I need tight layout and then I noticed that the extra space is actually appearing in many plots.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions