-
Couldn't load subscription status.
- Fork 30
Description
Hi Matthew,
Thanks for making my favorite ggplot extension package!
slab_alpha applies to both the fill of the slab, as well as the outline. While the alpha can work nicely for slabs with either a fill or an outline, it looks quite poor whenever both are present:
Consider e.g.:
dist_df <- data.frame(mean = 0, sd = 1)
ggplot(dist_df, aes(xdist = dist_normal(mean, sd))) +
stat_slab(fill = 'firebrick', color = 'black', slab_alpha = 0.6, slab_linewidth = 3)Half of the outline overlaps with the fill, while the other half does not, which makes the outline look like two outlines.
The desired result can be obtained by manually assigning a color with an alpha value:
ggplot(dist_df, aes(xdist = dist_normal(mean, sd))) +
stat_slab(fill = scales::alpha('firebrick', 0.6), color = 'black', slab_linewidth = 3)But perhaps it would be nicer if the alpha of the outline and the fill can be controlled separately, or, if ggdist follows the ggplot convention of applying the alpha only to fills (as in e.g. geom_density()).

